OldHawk

菜地一块,欢迎拍砖
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

how to advertent to connect to internet?

Posted on 2007-06-16 13:04  OldHawk  阅读(267)  评论(1编辑  收藏  举报
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;

is result = true then the system is connect to internet