Click here to Skip to main content
14,266,194 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi
I want to create a program that get a unique number or serial to me , for this job i want to get serial number of c drive of computer in csharp , because i think that it is unique for any computer in the world , is there any other way?
if yes , please say to me , what way can i try?
if no , please say how can i get serial number of "c" drive in csharp?
Posted
Updated 6-Jul-11 2:34am
v3
Rate this:
Please Sign up or sign in to vote.

Solution 3

Look at WMI via the System.Management namespace[^] - it provides calls to access all sorts of information about a PC.

But be aware, that simple security like this is easily hacked, and will frequently annoy genuine customers more than it deters pirates. A quick look at any of the torrent sites will show you what I mean...

[edit]I forgot to add this: How To Get Hardware Information (CPU ID, MainBoard Info, Hard Disk Serial, System Information , ...)[^] - an article on this very site which shows you how to get loads of info, including the HDD serial number - OriginalGriff[/edit]
   
v2
Rate this:
Please Sign up or sign in to vote.

Solution 4

That's nice and all, but getting the hard disk serial number has one major drawback. First, WMI cannot be used to consistantly get the serial number on all drives and on all platforms. There is nothing that says a manufacturer has to provide this information to WMI.

Second, there are about 4 different methods of getting the serial number of any single drive. Not every method works on every drive, so you'd have to try each method, evaluate what you get, then try the next method if needed, and so on.

Lastly, if your software is installed on a machine with multiple drives in a hardware RAID array, you cannot get the serial number of the drives. They are hidden by the array controller and the O/S only sees the RAID "drive". That "drive" usually will not have a serial number.
   
Rate this:
Please Sign up or sign in to vote.

Solution 1

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

Solution 2

See[^] how easy it is.
   

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




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