查了些资料,不能使用GetDriverType(),因为它返回DRIVE_REMOVABLE时表示的也可能是软驱
MSDN上说:
To determine whether a drive is a USB-type drive, call SetupDiGetDeviceRegistryProperty and specify the SPDRP_REMOVAL_POLICY property.
但是因为之前没有这方面的经验,好些概念都不明白,所以看不懂。
如果有详细点的说明,对我会有很大帮助,谢谢。
http://banderlogi.blogspot.com/2011/06/enum-drive-letters-attached-for-usb.html
我想代码应该挺清楚了。。
另外msdn那种说法应该是这个?
来自:http://stackoverflow.com/questions/220123/how-do-i-detected-whether-a-hard-drive-is-connected-via-usb#answer-223808