本文整理自网络,侵删。
use WinInet;
//正确检测是否在线方法
if InternetGetConnectedState(nil, 0) then
begin
Self.Caption := '在线';
end
else
begin
Self.Caption := '脱机';
end;
经测试,和QQ检测是否在线基本相同。
相关阅读 >>
Delphi 在rxrichedit中插入图片的完美解决方法
Delphi xe [dcc32 fatal error] f2039 could not create output file 问题的解决
更多相关阅读请进入《Delphi》频道 >>