当然可以,而且目前也只有.NET能够非常容易的实现。通过 WMI.NET 的 WMI查询,详细内容可参考 WMI.NET 文档
下面的例子可取得所有逻辑驱动器的信息
using System;
using System.Management;
class Query_SelectQuery
{
public static int Main(string[] args)
{
SelectQuery selectQuery = new SelectQuery("Win32_LogicalDisk");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(selectQuery);
foreach (ManagementObject disk in searcher.Get())
{
Console.WriteLine(disk.ToString());
}
Console.ReadLine();
return 0;
}
}