I am using the following line of code to grab directories off of a network share
system.IO.Directory.GetDirectories("\\Myserver\Datawarehouse\")
This works fine as long as that share has been accessed recently, if it hasn't the machine temporarly closes that connection, causing me to get a exception. The funny thing is that the command above does open the connection back up, but it's post the exception, which does me no good.
Is there something I can do to force this connection to re-open prior to running that command?
Thanks
system.IO.Directory.GetDirectories("\\Myserver\Datawarehouse\")
This works fine as long as that share has been accessed recently, if it hasn't the machine temporarly closes that connection, causing me to get a exception. The funny thing is that the command above does open the connection back up, but it's post the exception, which does me no good.
Is there something I can do to force this connection to re-open prior to running that command?
Thanks