[转帖]PB获取计算机名
<p>FUNCTION boolean GetComputerNameA(ref string cname,ref long nbuf) LIBRARY "kernel32.dll"</p><p><br/>String ls_computername=space(512)<br/>Long ll_buffer=512<br/>Getcomputernamea(ls_computername,ll_buffer)<br/>Return ls_computername</p> <p>PB11,需修改定义:</p><p></p><p>FUNCTION boolean GetComputerNameA(ref string cname,ref long nbuf) LIBRARY "kernel32.dll" ALIAS FOR "GetComputerNameA;ansi"<br/></p> <p>RegistryGet("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ComputerName","ComputerName",regstring!,gs_host)</p><p>这是最简单的,从9x~2003,计算机名都存在这个地方</p>
页:
[1]