Beispiel #1
0
        public RAM()
        {
            var iter = WMIQuery.WMIExecQuery(WMIQuery.RAM.Query).GetEnumerator();

            while (iter.MoveNext())
            {
                var wmi = iter.Current;
                Speed        = wmi[WMIQuery.RAM.Speed].ToString();
                Voltage      = wmi[WMIQuery.RAM.ConfiguredVoltage].ToString().Insert(1, ".");
                Manufacturer = wmi[WMIQuery.RAM.Manufacturer].ToString();
            }
            PysicalSize = info.TotalPhysicalMemory;
            VirtualSize = info.TotalVirtualMemory;
        }
Beispiel #2
0
        public CPU()
        {
            var iter = WMIQuery.WMIExecQuery(WMIQuery.CPU.Query).GetEnumerator();

            while (iter.MoveNext())
            {
                var wmi = iter.Current;
                Name         = wmi[WMIQuery.CPU.Name].ToString().Trim();
                CurrentClock = Convert.ToInt32(wmi[WMIQuery.CPU.MaxClock]);
                Voltage      = Convert.ToDouble(wmi[WMIQuery.CPU.Voltage]) / 10;
                L2CacheSize  = Convert.ToInt32(wmi[WMIQuery.CPU.L2CacheSize]);
                L3CacheSize  = Convert.ToInt32(wmi[WMIQuery.CPU.L3CacheSize]);
                CoreCount    = Convert.ToInt32(wmi[WMIQuery.CPU.NumberOfCores]);
                ThreadCount  = Convert.ToInt32(wmi[WMIQuery.CPU.ThreadCount]);
            }
        }
Beispiel #3
0
        public DetailDisk()
        {
            /*DiskPartitions = WMIQuery.WMIExecQuery(WMIQuery.Disk.LogicalToPartitionQuery)
             *  .GroupBy(
             *      p => int.Parse(Regex.Match(p["Antecedent"].ToString(), @"(?<=Disk #)\d+").Value), // physical disk index
             *      p => Regex.Match(p["Dependent"].ToString(), "(?<=DeviceID=\").*?(?=\")").Value)   // device id (Volume label)
             *  .ToDictionary(
             *      g => g.Key,
             *      g => g.ToArray());
             *
             * LogicalDisks = WMIQuery.WMIExecQuery(WMIQuery.Disk.LogicalDiskQuery)
             *  .ToDictionary(
             *      d => d["DeviceID"].ToString(), // device id
             *      d => d);*/

            DiskDrives = WMIQuery.WMIExecQuery(WMIQuery.Disk.DiskDriveQuery)
                         .OrderBy(d => d["Index"].ToString()) // disk index
                         .ToArray();
        }
Beispiel #4
0
        public GPU()
        {
            var iter = WMIQuery.WMIExecQuery(WMIQuery.GPU.Query).GetEnumerator();

            while (iter.MoveNext())
            {
                var wmi = iter.Current;
                AdapterCompatiability = wmi[WMIQuery.GPU.AdapterCompatibility].ToString();
                AdapterRAM            = wmi[WMIQuery.GPU.AdapterRAM].ToString();
                Caption              = wmi[WMIQuery.GPU.Caption].ToString();
                CurrentRefreshRate   = wmi[WMIQuery.GPU.CurrentRefreshRate].ToString();
                DriverDate           = wmi[WMIQuery.GPU.DriverDate].ToString();
                DriverVersion        = wmi[WMIQuery.GPU.DriverVersion].ToString();
                MaxRefreshRate       = wmi[WMIQuery.GPU.MaxRefreshRate].ToString();
                MinRefreshRate       = wmi[WMIQuery.GPU.MinRefreshRate].ToString();
                VideoModeDescription = wmi[WMIQuery.GPU.VideoModeDescription].ToString();
                VideoProcessor       = wmi[WMIQuery.GPU.VideoProcessor].ToString();
            }
            DriverDate = DriverDate.Split('.')[0];
        }
Beispiel #5
0
        public OS()
        {
            String[] MUI;
            var      iter = WMIQuery.WMIExecQuery(WMIQuery.OS.Query).GetEnumerator();

            while (iter.MoveNext())
            {
                var wmi = iter.Current;
                Caption         = wmi[WMIQuery.OS.Caption].ToString();
                Architecture    = wmi[WMIQuery.OS.Architecture].ToString();
                BuildNumber     = wmi[WMIQuery.OS.BuildNumber].ToString();
                Version         = wmi[WMIQuery.OS.Version].ToString();
                SerialNumber    = wmi[WMIQuery.OS.SerialNumber].ToString();
                LastBootUpTime  = wmi[WMIQuery.OS.LastBootUpTime].ToString();
                ContryCode      = wmi[WMIQuery.OS.CountryCode].ToString();
                CurrentTimeZone = wmi[WMIQuery.OS.CurrentTimeZone].ToString();
                MUI             = (String[])wmi[WMIQuery.OS.MUILanguages];
                Language        = wmi[WMIQuery.OS.Language].ToString();
                InstallTime     = ManagementDateTimeConverter.ToDateTime(wmi[WMIQuery.OS.InstallDate].ToString());
                MUILanguages    = String.Join(", ", MUI);
            }
        }