查ip
var Phe: PHostEnt;
// HostEntry buffer for name lookup
theHostName, HostIP: String
begin
Phe := GetHostByName(PChar(hostname));
if Phe = Nil then result:=WSAGetLastError
else begin
Address := longint(plongint(Phe^.h_addr_list^)^);
theHostName := Phe^.h_name;
HostIP := StrPas(inet_ntoa(TInAddr(Address)));
end;
end;