怎样获得内部IP和上网IP?急,在线等待 我有一台机器,有内部的IP:192.168.0.1,同时有时作为代理服务器上网的,我想用delphi分别得到这台机的内部IP和上网IP, 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 uses winsock;function LocalIP1 : string;type TaPInAddr = array [0..10] of PInAddr; PaPInAddr = ^TaPInAddr;var phe : PHostEnt; pptr : PaPInAddr; Buffer : array [0..63] of char; I : Integer; GInitData : TWSADATA;begin WSAStartup($101, GInitData); Result := ''; GetHostName(Buffer, SizeOf(Buffer)); phe :=GetHostByName(buffer); if phe = nil then Exit; pptr := PaPInAddr(Phe^.h_addr_list); I := 0; while pptr^[I] <> nil do begin result:=StrPas(inet_ntoa(pptr^[I]^)); Inc(I); end; WSACleanup;end; delphi中调用vb里的winsock控件该怎么做呀?能说明具体点嘛?谢谢! 对动态连接库熟悉的高手请进! 请一定要看看!帮帮我! 关于DELPHI书的问题 关于图片的打印 ADO连接问题 AND TREELISTVIEW问题? 鸟问,关于DELPHI6…… 怎么用treeView实现数据的分层显示啊 什么是三层?什么是分布式系统?什么是COM?什么是DCOM? 请问如何将jpg图片保存到oracle数据库中? 如何把数组的申明转化为指针? 如何用C++ Builder写ASP组件?
function LocalIP1 : string;
type
TaPInAddr = array [0..10] of PInAddr;
PaPInAddr = ^TaPInAddr;
var
phe : PHostEnt;
pptr : PaPInAddr;
Buffer : array [0..63] of char;
I : Integer;
GInitData : TWSADATA;begin
WSAStartup($101, GInitData);
Result := '';
GetHostName(Buffer, SizeOf(Buffer));
phe :=GetHostByName(buffer);
if phe = nil then Exit;
pptr := PaPInAddr(Phe^.h_addr_list);
I := 0;
while pptr^[I] <> nil do begin
result:=StrPas(inet_ntoa(pptr^[I]^));
Inc(I);
end;
WSACleanup;
end;