同上

解决方案 »

  1.   

    InternetGetConnectedState
    ====
    InternetGetConnectedState returns TRUE if there is an Internet connection, 
    or FALSE otherwise.  This is a sample code: DWORD flag;
    BOOL con = InternetGetConnectedState(&flag,0);InternetGetConnectedState will usually give you the information you need, 
    but sometimes it returns a wrong result. One problem with 
    InternetGetConnectedState is that if an internet connection has never been 
    configured on a machine (even if there is no network card) it will return 
    TRUE and lpdwFlags will be set to INTERNET_CONNECTION_LAN.  Obviously it 
    does not have a legitimate connection to the internet in this case.
    For more inforamtion about InternetGetConnectedState please see:
    http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/winin
    et/reference/functions/internetgetconnectedstate.asp
      

  2.   

    yes ,you can create a monitor process using this function