远程控制篇:通过IP地址得到机器名 (转)[@more@]
function iptoname(ip:string):string;
var
WSAData:TWSAData;
p:PHostEnt;
.NETAddr:dword;
begin
WSAStartup(2, WSAData);
InetAddr:= inet_addr(PChar(IP));
try
p:=GetHostByAddr(@InetAddr, Length(IP), PF_Inet);
result:=p^.h_name;
except
result:=';
end;
end;
官本和 2001.4
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10752043/viewspace-988204/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10752043/viewspace-988204/