不好意思!刚刚一来 这个我也不大清楚。不这这个东西对你可能有帮助:
获取当前连接的IP地址,清参阅一下代码:
TRASCONN = packed record
dwSize : DWORD;
hRasConn : THRASCONN;
szEntryName : array [0..RAS_MaxEntryName] of char;
{$IFDEF WINVER400}
szDeviceType : array [0..RAS_MaxDeviceType] of char;
szDeviceName : array [0..RAS_MaxDeviceName] of char;
{$ENDIF}
szPadding : array [0..0] of Char;
end;
TRASPPPIP = record
dwSize : DWORD;
dwError : DWORD;
szIpAddress : array [0..RAS_MaxIpAddress] of char;
end;
function GetIPAddress: string;
var
RASConns : TRasConn;
dwSize : DWORD;
dwCount : DWORD;
RASpppIP : TRASPPPIP;
begin
Result := '';
RASConns.dwSize := SizeOf(TRASConn);
RASpppIP.dwSize := SizeOf(RASpppIP);
dwSize := SizeOf(RASConns);
dwSize := SizeOf(RASpppIP);
RASpppIP.dwSize := SizeOf(RASpppIP);
if RASGetProjectionInfoA(RASConns.hRasConn,
RASP_PppIp,
@RasPPPIP,
@dwSize) = 0 then
Result := StrPas(RASpppIP.szIPAddress);
end;
function RasGetProjectionInfoA;
external rasapi32 name 'RasGetProjectionInfoA';