只要判断出来就好了,越简单越好,先谢了。

解决方案 »

  1.   

    是用delphi自己翻译下
    {=================================================================
      功  能:  检测计算机是否上网
      参  数:  无
      返回值:  成功:  True  失败: False;
      备 注:   uses Wininet
      版 本:
         1.0  2002/10/07 13:33:00
    =================================================================}
    function InternetConnected: Boolean;
    const
      // local system uses a modem to connect to the Internet.
      INTERNET_CONNECTION_MODEM      = 1;
      // local system uses a local area network to connect to the Internet.
      INTERNET_CONNECTION_LAN        = 2;
      // local system uses a proxy server to connect to the Internet.
      INTERNET_CONNECTION_PROXY      = 4;
      // local system's modem is busy with a non-Internet connection.
      INTERNET_CONNECTION_MODEM_BUSY = 8;
    var
      dwConnectionTypes : DWORD;
    begin
      

  2.   

    上面不全
    {=================================================================
      功  能:  检测计算机是否上网
      参  数:  无
      返回值:  成功:  True  失败: False;
      备 注:   uses Wininet
      版 本:
         1.0  2002/10/07 13:33:00
    =================================================================}
    function InternetConnected: Boolean;
    const
      // local system uses a modem to connect to the Internet.
      INTERNET_CONNECTION_MODEM      = 1;
      // local system uses a local area network to connect to the Internet.
      INTERNET_CONNECTION_LAN        = 2;
      // local system uses a proxy server to connect to the Internet.
      INTERNET_CONNECTION_PROXY      = 4;
      // local system's modem is busy with a non-Internet connection.
      INTERNET_CONNECTION_MODEM_BUSY = 8;
    var
      dwConnectionTypes : DWORD;
    begin
      dwConnectionTypes := INTERNET_CONNECTION_MODEM+ INTERNET_CONNECTION_LAN
      + INTERNET_CONNECTION_PROXY; 
      Result := InternetGetConnectedState(@dwConnectionTypes, 0);
    end;end.
      

  3.   

    连接服务器打开的端口,通常80和21是打开的,如果连接不成功,服务器 就down了
      

  4.   

    使用SOCKET和一个可靠的网站(每天都开启的)进行连接,端口可以常用端口如80,21都可以,如果成功就表示网络通了,如果你要过靠可以自己定义一个文本文件,写入要连接的地址用IP,如果使用域名不可靠,而端口也可以是从0-1000来连接