不要使用 InetIsOffline , 該狀態不即時不準確!!
代碼: 選擇全部
uses Wininet ..
...
procedure Tform1.Button3Click(Sender: TObject);
var
state: LONGWORD;
begin
if InternetGetConnectedState( @state, 0) then
showmessage('connected!')
else
showmessage('not connected!');
end;
請參考相關資料:
http://delphi.ktop.com.tw/topic.asp?topic_id=18940
http://www.25emuhome.com/column/learn/v ... c_five.htm
http://www.jane.com.tw/bbs/topic.asp?TO ... e=Internet