CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 1999
    Posts
    7

    How can I determin if a machine is connected to the internet ?

    Hi,

    I need to dtect in my program if a machine is connected to the net. However, the machine can be dialing independently using RAS or even be behind a LAN/proxy.

    I have tried using InternetGetConnectedState() however, it does not detect my machine as disconnected even when I physically disconnect my CAT 5 cable from the LAN (I am behind a LAN/Proxy)

    I cannot depend on InetIsOffline() because shell32.dll version 4 is not a prerequisite for my program.

    Can anybody help ?

    Any input would be appreciated.

    Thanx,

    sanjay


  2. #2
    Join Date
    May 1999
    Location
    Atlanta, GA, USA
    Posts
    443

    Re: How can I determin if a machine is connected to the internet ?

    Hi.

    Try CSocket or CAsyncSocket - Connect().

    Hope for help.
    -Masaaki Onishi-


  3. #3
    Join Date
    Apr 1999
    Posts
    7

    Re: How can I determin if a machine is connected to the internet ?

    Hello Masaaki ,

    Thanx for the info, I will be unable to do this directly because I am not writing an MFC based app.
    My app wants to be independent of MFC42.dll etc..

    However, I will check out the implementation of these methods by MFC and see if it is helpful.

    Any other method will be really helpful

    -sanjay


  4. #4
    Join Date
    May 1999
    Posts
    25

    Re: How can I determin if a machine is connected to the internet ?

    Rasenumconnections() functions tells you what Dial Up network connections are active.

    if you want to see if the network is actually ok you could try
    sending something to the echo port on a remote
    server such as www.microsoft.com or some other
    server you know and see if it echo's it back.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured