Форум: "Сети";
Текущий архив: 2002.04.11;
Скачать: [xml.tar.bz2];
ВнизОпять поднимаю вопрос, как определить в Delphi IP адрес полученный от проваёдера? Найти похожие ветки
← →
Yarix (2001-11-23 00:58) [17]program PPP_IP;
uses RAS_H, Windows;
{$R *.res}
{$R Yarix.res}
var bufsize: Longint;
numEntries: Longint;
x: Integer;
entries: Array[1..100] of TRasConn;
RasPppIp :TRasPppIp;
RasPppIpSize :integer;
ServerIP:string;
ClientIP:string;
Connection:string;
begin
entries[1].dwSize := SizeOf(TRasConn);
bufsize := SizeOf(TRasConn) * 100;
if RasEnumConnections(@entries[1], bufsize, numEntries) = 0 then
if numEntries > 0
then
for x := 1 to numEntries do
begin
Connection:=entries[x].szEntryName;
RasPppIpSize:=SizeOf(TRasPppIp);
RasPppIp.dwSize:=RasPppIpSize;
if RASGetProjectionInfo(entries[x].HRASCONN,RASP_PppIp,@RasPppIp,RasPppIpSize)<>0 then
begin
MessageBox(GetDesktopWindow,
"You are not connected to the Internet"+#10#13+"or your connection is not working properly.",
"PPP IP",
MB_OK or MB_ICONWARNING);
Halt;
end;
ServerIP:=RasPppIp.szServerIpAddress;
ClientIP:=RasPppIp.szIpAddress; ------ ВОТ ЧЕ ТЕ НАДО
MessageBox(GetDesktopWindow,
PChar("Remote Dial-Up Server""s IP Address: "+#9+ServerIP+#13#10+#13#10+
"PPP does not require that server provides his address, but"+#13#10+
"Windows NT servers will consistently return the address anyway."+#13#10+
"Other PPP vendors may not provide the address."+#13#10
),
PChar(Connection),MB_OK or MB_ICONWARNING);
end
else
begin
MessageBox(GetDesktopWindow,
"You are not connected to the Internet"+#10#13+"or your connection is not working properly.",
"PPP IP",
MB_OK or MB_ICONWARNING);
end;
end.
Страницы: 1 вся ветка
Форум: "Сети";
Текущий архив: 2002.04.11;
Скачать: [xml.tar.bz2];
Память: 0.44 MB
Время: 0.008 c