Created
May 27, 2019 10:30
-
-
Save Arefu/7aaf982103437aec92b7561947df27d0 to your computer and use it in GitHub Desktop.
Continuation from my Wmi and Class Project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Diagnostics; | |
using System.Management; | |
using System; | |
namespace CompInfo.WMI_Classes | |
{ | |
class Win32_BIOS | |
{ | |
public UInt16[] BiosCharacteristics; | |
public string[] BIOSVersion; | |
public string BuildNumber; | |
public string Caption; | |
public string CodeSet; | |
public string CurrentLanguage; | |
public string Description; | |
public byte EmbeddedControllerMajorVersion; | |
public byte EmbeddedControllerMinorVersion; | |
public string IdentificationCode; | |
public UInt16 InstallableLanguages; | |
public string InstallDate; | |
public string LanguageEdition; | |
public string[] ListOfLanguages; | |
public string Manufacturer; | |
public string Name; | |
public string OtherTargetOS; | |
public Boolean PrimaryBIOS; | |
public string ReleaseDate; | |
public string SerialNumber; | |
public string SMBIOSBIOSVersion; | |
public UInt16 SMBIOSMajorVersion; | |
public UInt16 SMBIOSMinorVersion; | |
public Boolean SMBIOSPresent; | |
public string SoftwareElementID; | |
public UInt16 SoftwareElementState; | |
public string Status; | |
public byte SystemBiosMajorVersion; | |
public byte SystemBiosMinorVersion; | |
public UInt16 TargetOperatingSystem; | |
public string Version; | |
public Win32_BIOS(ManagementBaseObject Instance) | |
{ | |
foreach(var WmiInstanceProperty in Instance.Properties) | |
{ | |
foreach(var LocalProperty in this.GetType().GetFields()) | |
{ | |
if(LocalProperty.Name == WmiInstanceProperty.Name) | |
{ | |
if (WmiInstanceProperty.Value != null) | |
{ | |
LocalProperty.SetValue(this, Convert.ChangeType(WmiInstanceProperty.Value, LocalProperty.FieldType)); | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment