var
WSAData: TWSAData;
HostName, IPAddress: String;
HostEnt: PHostEnt;
begin
WSAStartup(2, WSAData);
SetLength(HostName, 255);
GetHostname(PChar(HostName), 255);
SetLength(HostName, StrLen(PChar(HostName)));
HostEnt := GetHostByName(PChar(HostName));
with HostEnt^ do
IPAddress := Format('%d.%d.%d.%d',[Byte(h_addr^[0]), Byte(h_addr^[1]),
Byte(h_addr^[2]), Byte(h_addr^[3])]);
WSACleanup;
lipview.Caption := IPAddress;
end;
이렇게 해서 IP address 알아내려고 하는데... undeclared identifier 'TWSAData' 등의 에러메세지가
나옵니다.. 델파이 7쓰고 있구요... 왜 이런지 몰겠네요..
항상잘 답해주셔서 너무 감사드립니다..^^ 부탁 드릴게요!
|