什么是获取硬盘序列号不WMI的方法是什么? [英] What are the ways to obtain HDD serial number without WMI?
问题描述
我可以用获得硬盘序列号 ManagementObjectSearcher(SELECT * FROM Win32_PhysicalMedia)
,并为每个的ManagementObject
从结果集,我可以读取序列号。
我有兴趣获取这些信息(不WMI)的IDE和SATA硬盘的另一种方式,因为我得到。混合的结果与我目前的做法
修改 - 看来,唯一的方法是使用的DeviceIoControl
。任何人都可以点我的C#代码调用一个完整的例子的DeviceIoControl
?我有使用的P / Invoke
没有经验
环境:C#2.0,Windows 2000或更新。
的http:// www.winsim.com/diskid32/
I can get the HDD serial number using ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMedia")
, and for each ManagementObject
from the result set I can read the serial number.
I am interested in another way of obtaining this information (without WMI) for IDE and SATA HDD, since I get mixed results with my current approach.
Edit - It seems that the only alternative is using DeviceIoControl
. Can anyone point me to a full example of C# code invoking DeviceIoControl
? I have no experience using P/Invoke
.
Environment: C# 2.0, Windows 2000 or newer.
http://www.winsim.com/diskid32/
这篇关于什么是获取硬盘序列号不WMI的方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!