Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serial number of Hard Disk or Hard Drive

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#:

  1. How to get Hard-Disk SerialNumber in C# (no WMI)?
  2. How to retrieve HDD Firmware Serial number in .net?
  3. Hdd Serial Number
like image 414
Pritesh Avatar asked Apr 15 '11 11:04

Pritesh


People also ask

Does a hard drive have a serial number?

Next to each hard drive, you'll see the drive's serial number. This is the number that the manufacturer has assigned to the drive. That's a quick and easy way to read your hard drive's serial number!

Is hard disk serial number unique?

Technically, a serial number is an integer from 1 to infinity. Anything else should be called an identification code, or simply an id. Hard disks "serial numbers" are a combination of manufacturer, model and serial number codes, so in practice, they should be unique.

Does SSD have serial number?

Serial Number is on a separate label and is on the bottom of the SSD. Main label can be on the top or bottom of the SSD.


1 Answers

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.

like image 97
Pritesh Avatar answered Nov 15 '22 11:11

Pritesh