Q
quimbo
I have an application that we install at external clients offices.
during the setup, if a setting points to a mapped drive, i convert the
drive to a UNC using WNetGetUniversalName and store it in a
configuration file. This all works fine.
When my application wakes up, I use System.IO.Directory.Exists with
the UNC as a parameter. If the UNC is mapped, this works fine.
My problem occurs when the UNC does not exist, typically on weekends
when the UNC computer is shut down. I have the
System.IO.Directory.Exists wrapped in a Try Block and have code
execute if it is not found. However, the code is never executed and
it drops into my catch block which logs the exception. However, the
exception is empty.
If Not settingsIris.HL7ResultsFolder Is Nothing Then
If Not System.IO.Directory.Exists
(settingsIris.HL7ResultsFolderUNC) Then
'this code is never called
logger.Error("Results Folder Not Reachable - " &
settingsIris.HL7ResultsFolderUNC)
itsValid = False
End If
End If
If I test this on my pc within my network, and use a UNC that is not
connected, the appropriate code executes.
Is there another method i can use to determine that the Directory
exists?
during the setup, if a setting points to a mapped drive, i convert the
drive to a UNC using WNetGetUniversalName and store it in a
configuration file. This all works fine.
When my application wakes up, I use System.IO.Directory.Exists with
the UNC as a parameter. If the UNC is mapped, this works fine.
My problem occurs when the UNC does not exist, typically on weekends
when the UNC computer is shut down. I have the
System.IO.Directory.Exists wrapped in a Try Block and have code
execute if it is not found. However, the code is never executed and
it drops into my catch block which logs the exception. However, the
exception is empty.
If Not settingsIris.HL7ResultsFolder Is Nothing Then
If Not System.IO.Directory.Exists
(settingsIris.HL7ResultsFolderUNC) Then
'this code is never called
logger.Error("Results Folder Not Reachable - " &
settingsIris.HL7ResultsFolderUNC)
itsValid = False
End If
End If
If I test this on my pc within my network, and use a UNC that is not
connected, the appropriate code executes.
Is there another method i can use to determine that the Directory
exists?