Internet connection

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Krzysztof Kazmierczak

    #1

    Internet connection

    Hi All!

    How i can check if is there an internet connection
    available? When i use API functions
    (InternetAttemp tConnect, InternetCheckCo nnection,
    InternetGetConn ectedStateEx) i sometimes have diferent
    results (when there's no cable, functions says that i'm
    connected).
    Is there any other method instead of trying to catch the
    exception while proceding WebRequest and WebResponse when
    the network cable is unplugged?

    Thank you very much for any help!
    Kind regards
    Krzysztof Kazmierczak
  • Tian Min Huang

    #2
    RE: Internet connection

    Hi Krzysztof,

    You can use the WMI class MSNdis_MediaCon nectStatus in the root\wmi
    namespace. The NdisMediaConnec tStatus property gives the connection status
    of the NIC on the network. Please refer to the following thread for some
    code snippet:


    -8&oe=UTF-8&selm=OALX7BxA CHA.2352%40tkms ftngp02&rnum=8

    Hope this helps.

    Regards,

    HuangTM
    Microsoft Online Partner Support
    MCSE/MCSD

    Get Secure! ¨C www.microsoft.com/security
    This posting is provided ¡°as is¡± with no warranties and confers no rights.

    Comment

    Working...