Hello,
How would I quickly determine if a logical disk drive is ready to use?
I am developing for ver 1.1 so the DriveInfo class is not available to me.
The method I am currently using seems to be popular:
// force exception if drive not ready
DirectoryInfo dir = new DirectoryInfo(rootDirectoryName);
dir.GetDirectories();
Using this code and just catching the exception in an empty block seems to
work ok
if you only have 1 or 2 drives that are not ready (ie empty floppy and CD
drives). However, I have notice that it is not the fastest way since
throwing exceptions slows down the app. Is there a way to check each drive
without throwing an exception each time one is not ready? Is there a Win32
function (example code would be great) that I can use through interop?
Thanks,
Derick