本文介绍了如何仅获取在线驱动器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用ManagementObjectSearcher.我有以下C#代码行:
I am using the ManagementObjectSearcher. I have the following line of C# code:
ManagementObjectSearcher driveSearcher =新的ManagementObjectSearcher(从Win32_Diskdrive中选择设备ID");
ManagementObjectSearcher driveSearcher = new ManagementObjectSearcher("SELECT DeviceID FROM Win32_Diskdrive");
但是,这将返回所有驱动器,甚至是脱机驱动器.我可以在上面添加where子句以仅返回在线驱动器吗?
However, this returns all drives even the offline drives. Is there a where clause that I can add to the above to only return online drives?
谢谢.
推荐答案
这篇关于如何仅获取在线驱动器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!