p; public string GetMainBoardId()
{
string result = \"\";
ManagementObjectSearcher searcher = new ManagementObjectSearcher(\"root\\CIMV2\",
\"SELECT * FROM Win32_BaseBoard\");
ManagementObjectCollection moCollection = searcher.Get();
foreach (ManagementObject mObject in moCollection)
{
result += mObject[\"SerialNumber\"].ToString() + \" \";
}
return result;
}
/// <summary>
/// 主板编号
/// </summary>
/// <returns></returns>
public string GetNetworkAdapterId()
{
string result = \"\";
ManagementObjectSearcher searcher = new ManagementObjectSearcher(\"SELECT MACAddress FROM Win32_NetworkAdapter WHERE ((MACAddress Is Not NULL)AND (Manufacturer <> \''Microsoft\''))\");
ManagementObjectCollection moCollection = searcher.Get();
foreach (ManagementObject mObject in moCollection)
{
result += mObject[\"MACAddress\"].ToString() + \" \";
}
return result;
}