C# 如何判断用户插入的磁盘是移动硬盘还是小U盘?
C#如何判断用户插入的磁盘是移动硬盘还是小U盘?1.SelectQueryselectQuery=newSelectQuery("select*fromwin32_log...
C# 如何判断用户插入的磁盘是移动硬盘还是小U盘?
1.SelectQuery selectQuery = new SelectQuery("select * from win32_logicaldisk");
// ManagementObjectSearcher searcher = new ManagementObjectSearcher(selectQuery);
// foreach (ManagementObject disk in searcher.Get())
2.System.IO.DriveInfo.GetDrives();
以上两种方法我都试过了,不区分不了,不知道该怎么做了 展开
1.SelectQuery selectQuery = new SelectQuery("select * from win32_logicaldisk");
// ManagementObjectSearcher searcher = new ManagementObjectSearcher(selectQuery);
// foreach (ManagementObject disk in searcher.Get())
2.System.IO.DriveInfo.GetDrives();
以上两种方法我都试过了,不区分不了,不知道该怎么做了 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |