getdrivetype

GetDriveType in C#? or find out if my drive is removable?

∥☆過路亽.° 提交于 2020-01-30 04:31:12
问题 I am using Environment.GetLogicalDrives(); to get a list of drives. I remember in c++ i could use GetDriveType to find if the device was CD, removable, flash, etc and i am thinking i want to put a filter in my app to only show CD and removable on default. What is the GetDriveType equivalent in C#? google only showed me hacks to use the c++ call. 回答1: Yes, the framework includes a DriveType enumeration used by the DriveInfo class. Have a look at the GetDrives() method on MSDN. 回答2: You can use

GetDriveType in C#? or find out if my drive is removable?

廉价感情. 提交于 2019-12-17 21:04:13
问题 I am using Environment.GetLogicalDrives(); to get a list of drives. I remember in c++ i could use GetDriveType to find if the device was CD, removable, flash, etc and i am thinking i want to put a filter in my app to only show CD and removable on default. What is the GetDriveType equivalent in C#? google only showed me hacks to use the c++ call. 回答1: Yes, the framework includes a DriveType enumeration used by the DriveInfo class. Have a look at the GetDrives() method on MSDN. 回答2: DriveInfo

How can I determine the type of a particular drive?

南笙酒味 提交于 2019-12-11 08:57:50
问题 I feel somewhat noob yet with this of getting the Information of Hardware of the CPU, so i come with this request: Hard Drive, CD/DVD/Bluray reader, Floppy and if it's possible USB. I've been looking on MSDN GetDriveType but seems i'm bad at searching or i don't understand it. Any idea? 回答1: I'm not sure what you didn't understand about the documentation you linked to... The sole argument accepted by the function is the root directory of the drive you want to get information about (including

GetDriveType in C#? or find out if my drive is removable?

纵然是瞬间 提交于 2019-11-28 13:48:56
I am using Environment.GetLogicalDrives(); to get a list of drives. I remember in c++ i could use GetDriveType to find if the device was CD, removable, flash, etc and i am thinking i want to put a filter in my app to only show CD and removable on default. What is the GetDriveType equivalent in C#? google only showed me hacks to use the c++ call. Yes, the framework includes a DriveType enumeration used by the DriveInfo class. Have a look at the GetDrives() method on MSDN. DriveInfo is the class you are looking for. 来源: https://stackoverflow.com/questions/623254/getdrivetype-in-c-or-find-out-if