Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Verify for drive availability
Message
From
13/02/2009 04:32:08
 
 
To
12/02/2009 20:36:15
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Web
Miscellaneous
Thread ID:
01381168
Message ID:
01381522
Views:
50
This message has been marked as the solution to the initial question of the thread.
>>C# but easily translatable:
bool b = new DriveInfo("C").IsReady;
>
>Yes, this is a common approach. But, I have a UNC and I have to work with something like \\100.100.100.100\MyShareDrive. So, using the UNC approach is a little bit more difficult to detect if the drive is ready. I have seen a lot of approaches to get the UNC from a mapped drive but not vice versa. Also, for now, I am using an approach of verifying if a file exist but that is slow.

If you know the IP address you could ping that with a short timeout. Wouldn't confirm that the drive was ready but....
using System.Net.NetworkInformation;
PingReply response  = new Ping().Send("100.100.100.100", 5);
bool worked = response.Status == IPStatus.Success;
5ms was more than enough on my network,
C# I'm afraid, Regards,
Viv
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform