Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I have been made C# 2010 Application.
I am using Motherboard Serial number to register my application.

C#
using System.Management;
ManagementObjectSearcher MOS = new ManagementObjectSearcher("Select * From Win32_BaseBoard");
foreach (ManagementObject getserial in MOS.Get())
{
     txtCompanyKey.Text = getserial["SerialNumber"].ToString();
}


It works very well in most of the computers. But some computers return NULL or EMPTY string.
My idea is that old motherboards cannot return serial Number. If my idea is true or not please give me some solution.
Thanks
Posted
Comments
Sergey Alexandrovich Kryukov 14-Feb-13 14:41pm    
What could be a solution if this data is not available? You already know that there is no a solution for the motherboard unique number, so, if you still need a solution, tell us: a solution for what?
—SA

It's not true - some modern ones don't either.
The problem is that the data is not "required for compatibility" - so it's cheaper not to add it, so it doesn't get added by all manufacturers.

Sorry, but you can't rely on the MB serial number alone for any form of security (and many of the others can be spoofed as well)
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 14-Feb-13 15:09pm    
Agree, a 5.
—SA
The simple answer is that you simply cannot rely on this value to do this. There is no solution.

What you need to do is find another way to register your application. Perhaps you could gather information on multiple parts of a machine and then generate a hash from those values so that as long as one of those components exist you get a valid result. Save the hash at that point.

My personal perspective is that tying a piece of software down to a specific machine is in no way a good way to register an application, so I would suggest looking to do this in a completely different way.

To learn a little more read this[^] article.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 14-Feb-13 15:08pm    
Good points, a 5.
—SA
Espen Harlinn 14-Feb-13 15:09pm    
Good points :-D
fjdiewornncalwe 14-Feb-13 15:20pm    
Thanks, Espen.
fjdiewornncalwe 14-Feb-13 15:20pm    
Thanks, Sergey.
This works most of the time[^], but I'm afraid you'll find it a bit of a bother.

Another option is to look for the BIOS Serial number[^], using Wmi32_BIOS[^]

Best regards
Espen Harlinn
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 14-Feb-13 15:08pm    
My 5. A combination of some not 100% unique features can make for "almost unique" configuration, but it does not look fair to the users. What, no upgrade, no transfer to a different machine?
—SA
Espen Harlinn 14-Feb-13 15:14pm    
Thank you, Sergey :-D
>>What, no upgrade, no transfer to a different machine?
Office 2012:http://www.geek.com/articles/geek-pick/retail-copies-of-office-2013-are-tied-to-a-single-computer-forever-20130213/#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled&id=I0_1360872795974&parent=http%3A%2F%2Fwww.geek.com&rpctoken=62649594
fjdiewornncalwe 14-Feb-13 15:21pm    
Just because Microsoft does it doesn't make it good... :)
Espen Harlinn 14-Feb-13 15:28pm    
True ...
Sergey Alexandrovich Kryukov 14-Feb-13 15:23pm    
What?! It sucks. Thank goodness I have older Office from my previous MSDN subscription which was already successfully transferred. However, if I did not have it, I would not be sorry... :-)
—SA

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

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900