In a Windows Desktop .NET C# (7.0) application...
We use the motherboard serial number for licensing. Recently a customer with dual CPU's is reporting a blank serial number. We've not had any issues before.
This code is not returning a "motherboardID" string.
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_BaseBoard"); ManagementObjectCollection collection = searcher.Get(); ManagementObject motherboard = collection.Cast<ManagementObject>().FirstOrDefault();string motherboardId = string.Empty;if (motherboard != null){ motherboardId = motherboard["SerialNumber"].ToString();}
Unfortunately, the customer is not nearby so I can't test. I'm not sure if the motherboard object is null or the "ToString() is returning empty.
Any advice?