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