procedure TForm1.Button1Click(Sender: TObject);
var
WSAData: TWSAData;
HostEnt: PHostEnt;
sComputerName, sIP: string;
begin
sComputername:=edit1.text;
WSAStartup(2, WSAData);
HostEnt := gethostbyname(PChar(sComputerName));
if HostEnt <> nil then
begin
with HostEnt^ do
sIP := Format('%d.%d.%d.%d', [Byte(h_addr^[0]), Byte(h_addr^[1]), Byte(h_addr^[2]), Byte(h_addr^[3])]);
end;
WSACleanup;
edit2.text:=sIP;
end;
end.