Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. connected to the network ????????

connected to the network ????????

Scheduled Pinned Locked Moved C / C++ / MFC
c++sysadminquestion
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    si_69
    wrote on last edited by
    #1

    Hi does ne1 know the best way in c++ to detect if i have a network connection, ie. connected to the internet thanks si

    D RaviBeeR L K 4 Replies Last reply
    0
    • S si_69

      Hi does ne1 know the best way in c++ to detect if i have a network connection, ie. connected to the internet thanks si

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Does this help? http://www.pcausa.com/resources/InetActive.txt

      1 Reply Last reply
      0
      • S si_69

        Hi does ne1 know the best way in c++ to detect if i have a network connection, ie. connected to the internet thanks si

        RaviBeeR Offline
        RaviBeeR Offline
        RaviBee
        wrote on last edited by
        #3

        InetIsOffline() /ravi Let's put "civil" back in "civilization" Home | Articles | Freeware | Music ravib@ravib.com

        1 Reply Last reply
        0
        • S si_69

          Hi does ne1 know the best way in c++ to detect if i have a network connection, ie. connected to the internet thanks si

          L Offline
          L Offline
          l a u r e n
          wrote on last edited by
          #4

          i dont know about the other replies and if the info there works everytime but i found the most reliable way was to try to ping a site that (hopefully) wont be down if theres a better way they invented recently i'll be happ to know about it too


          "there is no spoon"
          biz stuff   about me

          1 Reply Last reply
          0
          • S si_69

            Hi does ne1 know the best way in c++ to detect if i have a network connection, ie. connected to the internet thanks si

            K Offline
            K Offline
            kochhar
            wrote on last edited by
            #5

            I've been using the following function with success. It returns TRUE if a connection is available, and takes less than a sec in either case: BOOL Online() { DWORD dwState = 0; DWORD dwSize = sizeof(DWORD); return InternetQueryOption(NULL, INTERNET_OPTION_CONNECTED_STATE, &dwState, &dwSize) && (dwState & INTERNET_STATE_CONNECTED); } Credit: I got this from Paul Dilascia's column in MSDN mag a while back.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups