views:

37

answers:

1

I've already tried System.IO.DriveType. But it only provides to me with the information of whether it's a removable drive such as floppy disc or a USB flash drive. And a USB external hard drive will be recognized as a local non-removable drive in this case.

Furthermore, since there are more than one kinds of external hard drive, for example, USB and IEEE 1394. It's really hard to figure it out from ports.

Any information will be appreciated.

A: 

Im afraid this is not possible from a "high" level such as .net. For windows it is also transparant.

You're best try will be to figure out which system resources are in use and by what devices. This way you can see for example that some usb port is in use by some harddrive.

Henri
Thanks. I got some hints from http://www.codeproject.com/KB/winsdk/usbdisks.aspxhttp://www.ureader.com/msg/14742190.aspxSeems port information can be retrieved using DeviceIoControl with IOCTL_STORAGE_QUERY_PROPERTY and something else. I am not quite sure, yet. And this is an under hood solution, so the next step is to wrap it up and present it to the .net world.
biajee