InternetGetConnectedState
BOOL InternetGetConnectedState(OUT LPDWORD lpdwFlags,IN DWORD dwReserved);Retrieves the connected state of the local system. Returns TRUE if there is an Internet connection, FALSE otherwise.
lpdwFlags
Address of a double-word variable where the connection description should be returned. Can be a combination of the following values: INTERNET_CONNECTION_MODEM Local system uses a modem to connect to the Internet.
INTERNET_CONNECTION_LAN Local system uses a local area network to connect to the Internet.
INTERNET_CONNECTION_PROXY Local system uses a proxy server to connect to the Internet.
INTERNET_CONNECTION_MODEM_BUSY Local system's modem is busy with a non-Internet connection. dwReserved
Reserved. Must be set to zero.
BOOL InternetGetConnectedState(OUT LPDWORD lpdwFlags,IN DWORD dwReserved);Retrieves the connected state of the local system. Returns TRUE if there is an Internet connection, FALSE otherwise.
lpdwFlags
Address of a double-word variable where the connection description should be returned. Can be a combination of the following values: INTERNET_CONNECTION_MODEM Local system uses a modem to connect to the Internet.
INTERNET_CONNECTION_LAN Local system uses a local area network to connect to the Internet.
INTERNET_CONNECTION_PROXY Local system uses a proxy server to connect to the Internet.
INTERNET_CONNECTION_MODEM_BUSY Local system's modem is busy with a non-Internet connection. dwReserved
Reserved. Must be set to zero.
type
TaPInAddr = array [0..10] of PInAddr;
PaPInAddr = ^TaPInAddr;
var
phe : PHostEnt;
pptr : PaPInAddr;
Buffer : array [0..63] of char;
I : Integer;
GInitData : TWSADATA;
flag:dword;
begin
WSAStartup($101, GInitData);
FINET_AssignedIP :='';
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
FINET_AssignedIP:=StrPas(inet_ntoa(pptr^[I]^));
Inc(I);
end;
WSACleanup;
end;