dim DriveList as string() = Environment.GetLogicalDrives
gives me a string array of every drive on the system
If I cast any of those strings as a directoryinfo, and it is, for instance,
'A:\' and drive A is empty, I get an exception when it is referenced.
Is there any way to test to see if it will cause an exception before getting
the exception?
Thanks,
G
Herfried K. Wagner [MVP] - 29 Apr 2005 23:07 GMT
"G Dean Blake" <gb@nospam.com> schrieb:
> dim DriveList as string() = Environment.GetLogicalDrives
> gives me a string array of every drive on the system
[quoted text clipped - 5 lines]
> Is there any way to test to see if it will cause an exception before
> getting the exception?
You can try to catch the exception.

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>