硬盘或硬盘驱动器的序列号序列号、硬盘、硬盘驱动器

2023-09-02 10:30:48 作者:喵喵

起初,它可能似乎是很容易的问题,一些身体可能是想给我的建议去尝试谷歌,也可能是这样。 但是,对我来说是很辛苦,我已经尝试谷歌,堆栈溢出,找不到什么好的解决办法。

只是想用C#获取硬盘或硬盘驱动器的序列号

请仔细阅读:硬盘序列号,而不是硬盘(如C,D,E等)的卷序列号

有关获取硬盘卷序列号我已经找到解决方案对净及其工作很好,但问题是获取硬盘的序列号。

有些机构可以努力使这个问题成为低于股权溢出问题可能复制或可能暗示该问题的链接。但它不是

硬盘序列号修改器 ZOL下载

和没有任何问题,下面提供了针对此问题在C#中很好的解决方案:

如何获得硬盘的SerialNumber在C# (无WMI)? How检索硬盘固件序列号在.NET? 移动硬盘序列号 解决方案

这是最终的解决方案:

获取物理硬盘没有WMI 序列号

写这么多code:

  DriveListEx DISKINFO =新DriveListEx();
diskInfo.Load();
串系列号= DISKINFO [0] .SerialNumber;
 

不要忘了添加引用 DriveInfoEx.dll

At first it may seems it is very easy question and some body may be trying to give me advice to try Google, it may be so. But for me it is very hard I have try Google, Stack Overflow and can’t find any good solution.

Just want to get Serial number of Hard Disk or Hard Drive using C#

Please read carefully: serial number of Hard Disk, but not Serial number of Volume of Hard Disk (e.g. C, D, E, etc).

For getting serial no of volume of hard disk I have found solution on net and its work well but problem is with Getting serial number of Hard Disk.

Some body may trying to make this question as possible copy of below Stake Overflow question or may suggest link of that question. But it is not

And not any below question provides good solution for this problem in C#:

How to get Hard-Disk SerialNumber in C# (no WMI)? How to retrieve HDD Firmware Serial number in .net? Hdd Serial Number

解决方案

This is the final solution:

Get Physical HDD Serial Number without WMI

write this much code:

DriveListEx diskInfo = new DriveListEx();
diskInfo.Load();
string serialNo = diskInfo[0].SerialNumber;

Don't forgot to add reference to the DriveInfoEx.dll.

 
精彩推荐
图片推荐