using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Management; using System.Diagnostics; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { Debug.Print(getBiosSN()); } public static string getBiosSN() { ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from Win32_BIOS"); ManagementObjectCollection objects = searcher.Get(); foreach (ManagementObject obj in objects) { try { if (obj.GetPropertyValue("SerialNumber") != null) { return obj["SerialNumber"].ToString(); } } catch (Exception) { } } return string.Empty; } } }