转自:
http://www.delphitop.com/html/wangluo/2990.html
use WinInet;
//正确检测是否在线方法
if InternetGetConnectedState(nil, 0) then
begin
Self.Caption := '在线';
end
else
begin
Self.Caption := '脱机';
end;
经测试,和QQ检测是否在线基本相同。
use WinInet;
//正确检测是否在线方法
if InternetGetConnectedState(nil, 0) then
begin
Self.Caption := '在线';
end
else
begin
Self.Caption := '脱机';
end;
经测试,和QQ检测是否在线基本相同。
本文介绍了一种使用Delphi中的WinInet单元进行在线状态检测的方法,并提供了具体的代码实现。该方法通过调用InternetGetConnectedState函数来判断当前计算机是否连接到互联网,实测效果与QQ软件的在线检测功能相似。
909

被折叠的 条评论
为什么被折叠?



