Wednesday, October 14, 2009

C# get serial number of your PC motherboard



In this post i will show how you can get your PC motherboard serial number. Btw . Those sort of information can be very useful when you need to create some protection generating a protection for your software product and similar things ;)

One important thing in this post you will need to add reference to System.Menagement dll



We need to add the :

using System.Management;

and in button click event next code:)

private void button1_Click(object sender, EventArgs e)
{
ManagementObjectSearcher MOS = new ManagementObjectSearcher("Select * From Win32_BaseBoard");
foreach (ManagementObject getserial in MOS.Get())
{
label1.Text="Your motherboard serial is : "+ getserial["SerialNumber"].ToString();
}

}


for the end of this post , I will like to said hello to one beautiful girl called Sandy ;)

0 comments:

Post a Comment

Locations of visitors to this page