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

后端 未结 4 1574
傲寒
傲寒 2021-01-18 01:32

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 t

4条回答
  •  春和景丽
    2021-01-18 01:50

    Yes, the framework includes a DriveType enumeration used by the DriveInfo class. Have a look at the GetDrives() method on MSDN.

提交回复
热议问题