Answers for "c# get motherboard id"

C#
1

c# get motherboard id

public static string GetMotherBoardID()
{
	string mbInfo = String.Empty;
	ManagementScope scope = new ManagementScope("\\\\" + Environment.MachineName + "\\root\\cimv2");
	scope.Connect();
	ManagementObject wmiClass = new ManagementObject(scope, new ManagementPath("Win32_BaseBoard.Tag=\"Base Board\""), new ObjectGetOptions());

	foreach (PropertyData propData in wmiClass.Properties)
	{
		if (propData.Name == "SerialNumber")
			mbInfo = String.Format("{0,-25}{1}", propData.Name, Convert.ToString(propData.Value));
	}

	return mbInfo;
}
Posted by: Guest on March-02-2020

C# Answers by Framework

Browse Popular Code Answers by Language