I want to know my system information using C# 1. ProcessorId 2. Product 3. Manufacturer 4. Signature 5. Caption 6. PhysicalMedia(SerialNumber) 7. Version 8. OperatingSystem(SerialNumber) just call the method like this:
RunQuery("Processor", "ProcessorId"); RunQuery("BaseBoard", "Product"); RunQuery("BaseBoard", "Manufacturer"); RunQuery("DiskDrive", "Signature"); RunQuery("VideoController", "Caption"); RunQuery("PhysicalMedia", "SerialNumber"); RunQuery("BIOS", "Version"); RunQuery("OperatingSystem", "SerialNumber");
private static string RunQuery(string TableName, string MethodName) { ManagementObjectSearcher MOS = new ManagementObjectSearcher("Select * from Win32_" + TableName); foreach (ManagementObject MO in MOS.Get()) { try { return MO[MethodName].ToString(); } catch (Exception e) { System.Windows.Forms.MessageBox.Show(e.Message); } } return ""; }
0 comments
Post a Comment