procedure TForm1.Button1Click(Sender: TObject);
type
//copy the add_list
TAddrList = array [0..20] of PInAddr;
PAddrList = ^TAddrList;
var
phent : PHostEnt;
P: PAddrList;
I : Integer;
begin
//detect yahoo.com
phent := GetHostByName(pchar(edit1.text));
if phent<>nil then
begin
I := 0;
P := PAddrList(phent^.h_Addr_list);
while P <> nil do
begin
listbox1.items.Add(StrPas(inet_ntoa(P^)));
Inc(I)
end
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
WSAData : TWSAData;
begin
//initiates use of WS2_32.DLL
if (WSAStartup(MAKEWORD(2,0),WSAData)<>0) then
raise Exception.Create('Winsock Version Error');
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
WSACleanUP;
end;