with use the Wininet unit, we can discern to connect to internet.
this function is sample:
uses Wininet ;
function isconnected : Boolean ;
var
connectiontype: DWORD ;
begin
connectiontype:=INTERNET_CONNECTION_MODEM // type of connection
+INTERNET_CONNECTION_LAN
+INTERNET_CONNECTION_PROXY ;
Result:=InternetGetConnectedState(@connectiontype,0);//are we connect?
end;
this function is sample:
uses Wininet ;
function isconnected : Boolean ;
var
connectiontype: DWORD ;
begin
connectiontype:=INTERNET_CONNECTION_MODEM // type of connection
+INTERNET_CONNECTION_LAN
+INTERNET_CONNECTION_PROXY ;
Result:=InternetGetConnectedState(@connectiontype,0);//are we connect?
end;
is result = true then the system is connect to internet
本文转自 OldHawk 博客园博客,原文链接:http://www.cnblogs.com/taobataoma/archive/2007/06/16/785630.html,如需转载请自行联系原作者