IP地址转换DELPHI
作者:互联网
function IpStrToU(sIp:AnsiString):DWORD;
begin
Result:=inet_addr(pAnsiChar(sIp))
end;
function IpUToStr(U:Dword):AnsiString;
var
inaddr: TInAddr;
//sin:sockaddr_in;
begin
//sin.sin_addr.S_addr:=U;
inaddr.S_addr:=U;
Result:=StrPas(inet_ntoa(inaddr))
end;
标签:sIp,转换,addr,DELPHI,inaddr,IP地址,AnsiString,sin,inet 来源: https://blog.csdn.net/hailong7308/article/details/121362584