Use winsock;
Data Structure Definition: (MSDN 2004JAN)
TYPEDEF STRUCT HOSTENT {char far * h_name; // Domain Name Char far far ** h_aliases; // alias short h_addrtype; // address type, TCP, UDP is 2 Short h_length; // address length, IP is 4, that is, 4 Byte type digital char far far ** h_addr_list; // Digital queue, but the ASC code value is the IP value in the form of char.
Procedure TForm1.Button2Click (Sender: Tobject); Var pho: phostent; begin pho: = gethostByname (Pchar ('im.wxbpvii.cn'); showMessage . ' INTTOSTR (Byte (Pho.h_addr_list ^ [1])) '. ' INTOSTR (Byte (pho.h_addr_list ^ [2])) '. ' INTOSTR (Byte (pho.h_addr_list ^ [3] )))))))))