C# code to find your motherboard serial number

ManagementScope ms = new ManagementScope("\\" + Environment.MachineName + "\root\cimv2");
ms.Connect();
ManagementObject wmiClass = new ManagementObject(ms, new ManagementPath("Win32_BaseBoard.Tag="Base Board""), new ObjectGetOptions());
string sn = wmiClass.Properties.Cast<PropertyData>().Where(p => p.Name == "SerialNumber").FirstOrDefault().Value.ToString();
Console.WriteLine(sn);
Console.ReadKey(false);

// Please add reference to System.Management

Leave a Reply

Your email address will not be published. Required fields are marked *