D
doglive
Unregistered / Unconfirmed
GUEST, unregistred user!
/返回true则上网,否则false
function TFzjm.NetInternetConnected : boolean;
const
// local system uses a modem to connect to the Internet.
INTERNET_CONNECTION_MODEM = 1;
// local system uses a local area network to connect to the Internet.
INTERNET_CONNECTION_LAN = 2;
// local system uses a proxy server to connect to the Internet.
INTERNET_CONNECTION_PROXY = 4;
// local system's modem is busy with a non-Internet connection.
INTERNET_CONNECTION_MODEM_BUSY = 8;
var
dwConnectionTypes : DWORD;
begin
dwConnectionTypes := INTERNET_CONNECTION_LAN+INTERNET_CONNECTION_MODEM
+INTERNET_CONNECTION_PROXY;
//Result := InternetGetConnectedState(@dwConnectionTypes, 1);
Result := InternetGetConnectedState(@dwConnectionTypes, 0);
end;
我用这个函数来判断是否上网状态,可是编译的时候出现这样的错误:
[Error] uzjm.pas(132): Undeclared identifier: 'InternetGetConnectedState'
[Fatal Error] exam_dengji.dpr(12): Could not compile used unit 'uzjm.pas'
请问是为什么呢?
是不是少了个单元文件?该用哪个单元文件呢?
function TFzjm.NetInternetConnected : boolean;
const
// local system uses a modem to connect to the Internet.
INTERNET_CONNECTION_MODEM = 1;
// local system uses a local area network to connect to the Internet.
INTERNET_CONNECTION_LAN = 2;
// local system uses a proxy server to connect to the Internet.
INTERNET_CONNECTION_PROXY = 4;
// local system's modem is busy with a non-Internet connection.
INTERNET_CONNECTION_MODEM_BUSY = 8;
var
dwConnectionTypes : DWORD;
begin
dwConnectionTypes := INTERNET_CONNECTION_LAN+INTERNET_CONNECTION_MODEM
+INTERNET_CONNECTION_PROXY;
//Result := InternetGetConnectedState(@dwConnectionTypes, 1);
Result := InternetGetConnectedState(@dwConnectionTypes, 0);
end;
我用这个函数来判断是否上网状态,可是编译的时候出现这样的错误:
[Error] uzjm.pas(132): Undeclared identifier: 'InternetGetConnectedState'
[Fatal Error] exam_dengji.dpr(12): Could not compile used unit 'uzjm.pas'
请问是为什么呢?
是不是少了个单元文件?该用哪个单元文件呢?