Is there a computer identifier that i can obtain through Windows.Management or something.
I am creating authorization codes for software and I was wondering if there is a computer identifier which I can stick the password. It would then check the computer to see if it can run the software by way of the identifier.
Thanks.
j_sen21Posted Feb 1, 2008, 10:23 AM
Scott LyslePosted Feb 1, 2008, 1:41 AM
How about the board serial number; I would think that would be pretty unique, you can couple with the board maker which ought to cinch it.
using System.Management; public string GetBoardSerNo() { ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_BaseBoard"); foreach (ManagementObject wmi in searcher.Get()) { try { return "Serial Number: " + wmi.GetPropertyValue("SerialNumber").ToString(); } catch { } } return "Serial Number: Unknown"; } public string GetBoardMaker() { ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_BaseBoard"); foreach (ManagementObject wmi in searcher.Get()) { try { return Environment.NewLine + "Board Maker: " + wmi.GetPropertyValue ("Manufacturer").ToString(); } catch { } } return "Board Maker: Unknown"; }