精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>编程开发>>● Delphi>>Delphi 网络编程>>Re:怎样判断是否上网?

主题:Re:怎样判断是否上网?
发信人: kingron(金龍)
整理人: teleme(2001-03-25 20:37:52), 站内信件
回复人:Kingron(2000-12-25 9:45:00)  得0分 
使用下面的两个函数就可以:
例如:
if not inetisoffline then 
  showmessage('已经上网');
另外一个函数用法差不多。
//声明:
function InetIsOffline(res:dword=0):boolean;stdcall;external 'url.dll' name 'InetIsOffline';

function InternetGetConnectedState;stdcall;external 'wininet.dll' name 'InternetGetConnectedState';
 
 
回复人:Kingron(2000-12-25 9:49:00)  得0分 
哦,忘记了,还有一点儿:

function InternetGetConnectedState(uflag:dword;reverse:dword):boolean;stdcall;

function InetIsOffline(res:dword=0):boolean;stdcall;
 
 
回复人:d_fang(2000-12-25 10:01:00)  得0分 
请问这个函数在那个单元中 
 
回复人:Kingron(2000-12-25 10:09:00)  得0分 
这两个函数要自己声明的,我都已经帮你写出来了!
function InetIsOffline(res:dword=0):boolean;stdcall;external 'url.dll' name 'InetIsOffline';

function InternetGetConnectedState(uflag:dword;reverse:dword);stdcall;external 'wininet.dll' name 'InternetGetConnectedState';




----
██████
█┏━━┓█
█┃之金┃█   访问Delphi版请点击这儿:Delphi版直达快车
█┃印龍┃█
█┗━━┛█
██████

[关闭][返回]