Click here to Skip to main content
13,149,756 members (59,185 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
Hello friends,

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…….

But for me it is very hard I have try Google and can’t find any good solution…
What should be is…..
Just want to get Serial no of Hard Disk or Hard Drive….using C#
Please read carefully, serial no of Hard Disk, But not Serial no 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 no of Hard Disk………
Some body may trying to make this question as possible copy of Below question or may suggest link of that question….But it is not

And not any below question provide good solution for this problem in C#....
1. http://stackoverflow.com/questions/4559700/how-to-get-hard-disk-serialnumber-in-c-no-wmi
2. http://stackoverflow.com/questions/3139276/how-to-retrieve-hdd-firmware-serial-number-in-net
3. http://stackoverflow.com/questions/677251/hdd-serial-number
One article (in C#) at link, it gives every parameter nicely other than serial no…
How to Retrieve the REAL Hard Drive Serial Number
You can read discussion at below that article to conform………
Posted 15-Apr-11 2:03am
Updated 15-Apr-11 2:35am
v4
Comments
Dalek Dave 7-Nov-11 3:33am
   
Actually, that is a fairly good question, and well set out.
Pritesh Aryan 11-Nov-11 2:04am
   
Thank you so mcuh Dalek Dave for your compliment.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

Or have a look at this article about WMI that gives you a lot of info including the harddisk serial.
How To Get Hardware Information (CPU ID, MainBoard Info, Hard Disk Serial, System Information , ...)[^]

Good luck!
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

Hello friends............
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;

Dont't forgot to add reference to the "DriveInfoEx.dll".....
  Permalink  
v3
Comments
avigodse 15-Apr-11 11:38am
   
But, this actually gives drive volume serial number, which is tend to change if formatted or partitioned.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 7

Great work!Thank for your solution!!!
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 8

This is a pretty good solution and even better if you have C# knowledge http://www.geekpedia.com/tutorial233_Getting-Disk-Drive-Information-using-WMI-and-Csharp.html[^]
  Permalink  
Comments
CHill60 1-Sep-15 8:26am
   
C# example using WMI was posted over 4 years ago. This solution adds nothing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web02 | 2.8.170924.2 | Last Updated 1 Sep 2015
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100