Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11661

Get Motherboard Serial Number Fails

$
0
0

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?


Viewing all articles
Browse latest Browse all 11661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>