예제 #1
0
        public static string GetActiveMacAddress()
        {
            string property  = "MACAddress";
            string condition = "IPEnabled = TRUE";

            return(Wmi.PropertyQuery <string>(Wmi.NETWORKADAPTER_CLASSNAME, property, condition));
        }
예제 #2
0
        // Token: 0x0600005B RID: 91 RVA: 0x00003250 File Offset: 0x00001450
        public static string GetActiveMacAddress()
        {
            string property  = "MACAddress";
            string condition = "IPEnabled = TRUE";

            return(Wmi.PropertyQuery <string>("Win32_NetworkAdapterConfiguration", property, condition, null));
        }
예제 #3
0
        private static void QueryExample()
        {
            // Print Caption and OSArchitecture from Win32_OperatingSystem class
            WmiClassCollection classCollection = Wmi.Query("Win32_OperatingSystem", new string[] { "Caption", "OSArchitecture" });

            foreach (WmiClass wmiClass in classCollection)
            {
                Console.WriteLine(wmiClass["Caption"].Value);
                Console.WriteLine(wmiClass["OSArchitecture"].Value);
            }

            // Print out all properties for all Win32_Processor classes
            WmiClassCollection classCollection2 = Wmi.Query("Win32_Processor");

            foreach (WmiClass wmiClass in classCollection2)
            {
                foreach (WmiProperty property in wmiClass.Properties)
                {
                    Console.WriteLine($"{property.Value}: {property.Name}");
                }
            }

            // Get a single property from Win32_OperatingSystem
            string windowsName = Wmi.PropertyQuery <string>("Win32_OperatingSystem", "Caption");

            Console.WriteLine(windowsName);
        }
예제 #4
0
 // Token: 0x06000062 RID: 98 RVA: 0x000032E7 File Offset: 0x000014E7
 public static string GetBootDevice()
 {
     return(Wmi.PropertyQuery <string>("Win32_OperatingSystem", "BootDevice", null));
 }
예제 #5
0
 // Token: 0x06000061 RID: 97 RVA: 0x000032D5 File Offset: 0x000014D5
 public static DateTime?GetLocalDateTime()
 {
     return(Wmi.PropertyQuery <DateTime?>("Win32_OperatingSystem", "LocalDateTime", null));
 }
예제 #6
0
 // Token: 0x0600004F RID: 79 RVA: 0x00002897 File Offset: 0x00000A97
 public static string GetManufacturer()
 {
     return(Wmi.PropertyQuery <string>("Win32_BIOS", "Manufacturer", null));
 }
예제 #7
0
 public static string GetDescription()
 => Wmi.PropertyQuery <string>(Wmi.BIOS_CLASSNAME, "Description");
예제 #8
0
 // Token: 0x0600004C RID: 76 RVA: 0x00002861 File Offset: 0x00000A61
 public static string GetCaption()
 {
     return(Wmi.PropertyQuery <string>("Win32_BIOS", "Caption", null));
 }
예제 #9
0
 public static string GetSystemDirectory()
 => Wmi.PropertyQuery <string>(Wmi.OPERATINGSYSTEM_CLASSNAME, "SystemDirectory");
예제 #10
0
 // Token: 0x0600005C RID: 92 RVA: 0x0000327B File Offset: 0x0000147B
 public static string GetCaption()
 {
     return(Wmi.PropertyQuery <string>("Win32_OperatingSystem", "Caption", null));
 }
예제 #11
0
 public static DateTime?GetLocalDateTime()
 => Wmi.PropertyQuery <DateTime?>(Wmi.OPERATINGSYSTEM_CLASSNAME, "LocalDateTime");
예제 #12
0
 public static string GetSystemDevice()
 => Wmi.PropertyQuery <string>(Wmi.OPERATINGSYSTEM_CLASSNAME, "SystemDevice");
예제 #13
0
 public static DateTime?GetInstallDate()
 => Wmi.PropertyQuery <DateTime?>(Wmi.OPERATINGSYSTEM_CLASSNAME, "InstallDate");
예제 #14
0
 public static string GetSerialNumber()
 => Wmi.PropertyQuery <string>(Wmi.OPERATINGSYSTEM_CLASSNAME, "SerialNumber");
예제 #15
0
 public static string GetOSArchitecture()
 => Wmi.PropertyQuery <string>(Wmi.OPERATINGSYSTEM_CLASSNAME, "OSArchitecture");
예제 #16
0
 // Token: 0x06000064 RID: 100 RVA: 0x0000330B File Offset: 0x0000150B
 public static string GetSystemDrive()
 {
     return(Wmi.PropertyQuery <string>("Win32_OperatingSystem", "SystemDrive", null));
 }
예제 #17
0
 public static string GetWindowsDirectory()
 => Wmi.PropertyQuery <string>(Wmi.OPERATINGSYSTEM_CLASSNAME, "WindowsDirectory");
예제 #18
0
 // Token: 0x06000066 RID: 102 RVA: 0x0000332F File Offset: 0x0000152F
 public static string GetWindowsDirectory()
 {
     return(Wmi.PropertyQuery <string>("Win32_OperatingSystem", "WindowsDirectory", null));
 }
예제 #19
0
 public static string GetName()
 => Wmi.PropertyQuery <string>(Wmi.BIOS_CLASSNAME, "Name");
예제 #20
0
 // Token: 0x06000068 RID: 104 RVA: 0x00003353 File Offset: 0x00001553
 public static uint?GetNumberOfProcesses()
 {
     return(Wmi.PropertyQuery <uint?>("Win32_OperatingSystem", "NumberOfProcesses", null));
 }
예제 #21
0
 public static bool?IsPrimaryBios()
 => Wmi.PropertyQuery <bool?>(Wmi.BIOS_CLASSNAME, "PrimaryBIOS");
예제 #22
0
 public static uint?GetNumberOfProcesses()
 => Wmi.PropertyQuery <uint?>(Wmi.OPERATINGSYSTEM_CLASSNAME, "NumberOfProcesses");
예제 #23
0
 // Token: 0x06000050 RID: 80 RVA: 0x000028A9 File Offset: 0x00000AA9
 public static bool?IsPrimaryBios()
 {
     return(Wmi.PropertyQuery <bool?>("Win32_BIOS", "PrimaryBIOS", null));
 }
예제 #24
0
 public static string GetManufacturer()
 => Wmi.PropertyQuery <string>(Wmi.BIOS_CLASSNAME, "Manufacturer");
예제 #25
0
 public static string GetCaption()
 => Wmi.PropertyQuery <string>(Wmi.OPERATINGSYSTEM_CLASSNAME, "Caption");
예제 #26
0
 public static string GetSerialNumber()
 => Wmi.PropertyQuery <string>(Wmi.BIOS_CLASSNAME, "SerialNumber");
예제 #27
0
 // Token: 0x0600005D RID: 93 RVA: 0x0000328D File Offset: 0x0000148D
 public static string GetOSArchitecture()
 {
     return(Wmi.PropertyQuery <string>("Win32_OperatingSystem", "OSArchitecture", null));
 }
예제 #28
0
 // Token: 0x0600005E RID: 94 RVA: 0x0000329F File Offset: 0x0000149F
 public static string GetSerialNumber()
 {
     return(Wmi.PropertyQuery <string>("Win32_OperatingSystem", "SerialNumber", null));
 }
예제 #29
0
 // Token: 0x0600004E RID: 78 RVA: 0x00002885 File Offset: 0x00000A85
 public static string GetName()
 {
     return(Wmi.PropertyQuery <string>("Win32_BIOS", "Name", null));
 }