在编写一部分PB应用程序时,我们可能获得计算机的名称,在PB中没有提供这样的类或方法,但是我们可以借助API函数来实现,下面是具体的实现源代码。
//获得当前计算机的名称FUNCTION boolean GetComputerNameA(ref string cname,ref long nbuf) LIBRARY "kernel32.dll"String ls_computername=space(512)Long ll_buffer=512Getcomputernamea(ls_computername,ll_buffer)Return ls_computername
本文源自:翔宇亭——IT乐园(http://),转载请保留此信息!