How to get motherboard serial number, Processor ID, VolumeSerialNumber using C#?

Add using System.Management; namespace in your application then //Get motherboard's serial number ManagementObjectSearcher mbs = new ManagementObjectSearcher("Select * From Win32_BaseBoard"); foreach (ManagementObject mo in mbs.Get()) { textBox1.Text = mo["SerialNumber"].ToString(); } //Get Processor's Identity mbs = new ManagementObjectSearcher("Select * From Win32_processor"); foreach (ManagementObject mo in mbs.Get()) { textBox2.Text = mo["ProcessorID"].ToString(); } //Get Network Adapter Configuration mbs = new ManagementObjectSearcher("Select * From Win32_NetworkAdapterConfiguration"); foreach (ManagementObject mo in mbs.Get()) { textBox3.Text = mo["MACAddress"].ToString(); break; } //Get Network Adapter Configuration mbs = new ManagementObjectSearcher("Select * From win32_logicaldisk"); foreach (ManagementObject mo in mbs.Get()) { textBox4.Text = mo["VolumeSerialNumber"].ToString(); }

Comments

  1. Thks Mr. Milind Mahajan , In one of the project I was needed to display the motherboard ID and within microseconds I was able to do it, Thks a lot.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. @ Mr. Milind W. Mahajan
    Thanks for the code.

    I tried your code to get MotherBoard Serial Number & Processor Identity on 4 different systems.

    1. On DualProcessor with Windows XP,
    MotherBoardSerial = 0123456789
    ProcessorID 1 = BFEBFBFF00010676
    ProcessorID 2 = BFEBFBFF00010676

    2. On Laptop with Widnows Vista,
    MotherBoardSerial = N/A
    ProcessorID 1 = BFEBFBFF00010676

    3. On normal system,
    MotherBoardSerial = BTEC81800YGW
    ProcessorID 1 = BFEBFBFF00010676

    4. On other normal system,
    MotherBoardSerial = BTEC911002P9
    ProcessorID 1 = BFEBFBFF0001067A

    How is this possible to have same ProcessorId for 3 different system & MotherBoardSerialNumber = "N/A" ?
    So how to uniquly identify any system?

    ReplyDelete
  5. Thank you for your post, it saved me some time. I had to change the NetworkAdapterConfiguration Query to get the MACAddress from:
    "mbs = new ManagementObjectSearcher("Select * From Win32_NetworkAdapterConfiguration"); "
    to
    "mbs = new ManagementObjectSearcher("Select * From Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'TRUE'");"

    In order to make it work, otherwise the query would fail.

    ReplyDelete
  6. Well, I have got the best information from here the site is fully stuffed with the knowledgeable information. biostar motherboard review

    ReplyDelete

Post a Comment

Popular posts from this blog

Fiserv Interview Questions.

AngularJs - Simple Example