【发布时间】:2013-11-25 13:35:14
【问题描述】:
我的机器上安装了一个 LTFS 磁带,我想以编程方式查找它的卷序列号。我发现'A00024'是右键单击->属性-> LTFSDetails的那个数字。我写了一个代码来动态查找它
class Program
{
static void Main(string[] args)
{
System.Management.ManagementObjectSearcher ms = new System.Management.ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMedia");
foreach (ManagementObject mo in ms.Get())
{
Console.WriteLine("serial.No " + mo["SerialNumber"]);
Console.WriteLine("Name " + mo["Name"]);
Console.WriteLine("Manufacterur " + mo["Manufacturer"]);
Console.WriteLine("model " + mo["Model"]);
Console.WriteLine("other info " + mo["OtherIdentifyingInfo"]);
Console.WriteLine("media type " + mo["MediaType"]);
Console.WriteLine("-----------");
}
Console.ReadKey();
}
}
但是这里返回的序列号是磁带驱动器序列号,我想这可能是制造商给硬件的序列号。知道如何找到 LTFS 卷序列号
【问题讨论】:
标签: c# console-application wmi