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. Problem detecting Availability of Network Path

Problem detecting Availability of Network Path

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpcomsysadmintools
2 Posts 2 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
    Sudhir Mangla
    wrote on last edited by
    #1

    I have created a program in which I need to determine the availability of a Shared folder path. Here is the sample code ********************************* #include m_sCopyToDrive = "t:\\test\\"; if( ::_access(m_sCopyToDrive.c_str(),0) == -1) { AfxMessageBox("Network is Down"); return FALSE; } else { AfxMessageBox("Network is UP"); } ***************************************** To check if the network is up I ran the following test. If Network connected.... result imediate Message box "Network is up" Disconnect ethernet cable from network. Program runs and after about 3 minutes "network is down" message box appears. It takes about another minute for function to return. Is there any other way to test if the network path is available or not Thanks for the help,

    Sudhir Mangla http://Programmerworld.net AND http://DevelopersVoice.com (Free books , articles , Source Code and Programming Tools and Utilities)

    D 1 Reply Last reply
    0
    • S Sudhir Mangla

      I have created a program in which I need to determine the availability of a Shared folder path. Here is the sample code ********************************* #include m_sCopyToDrive = "t:\\test\\"; if( ::_access(m_sCopyToDrive.c_str(),0) == -1) { AfxMessageBox("Network is Down"); return FALSE; } else { AfxMessageBox("Network is UP"); } ***************************************** To check if the network is up I ran the following test. If Network connected.... result imediate Message box "Network is up" Disconnect ethernet cable from network. Program runs and after about 3 minutes "network is down" message box appears. It takes about another minute for function to return. Is there any other way to test if the network path is available or not Thanks for the help,

      Sudhir Mangla http://Programmerworld.net AND http://DevelopersVoice.com (Free books , articles , Source Code and Programming Tools and Utilities)

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

      I don't know if it's any quicker, but look at the ISensNetwork interface.


      "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

      "Judge not by the eye but by the heart." - Native American Proverb

      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