示例#1
0
        private static void GathererExample()
        {
            // Security Gatherer
            ICollection <SecurityProduct> firewalls = SecurityGatherer.GetSecurityProducts(SecurityProductType.Firewall);
            var antiviruses = SecurityGatherer.GetSecurityProducts(SecurityProductType.AntiVirus);
            var antispyware = SecurityGatherer.GetSecurityProducts(SecurityProductType.AntiSpyware);

            foreach (var fw in firewalls)
            {
                Console.WriteLine(fw.Name);
            }

            foreach (var av in antiviruses)
            {
                Console.WriteLine(av.Name);
            }

            foreach (var asw in antispyware)
            {
                Console.WriteLine(asw.Name);
            }

            //Hardware Gatherer
            var   graphicsCards = HardwareGatherer.GetGraphicsCards();
            var   processors    = HardwareGatherer.GetProcessors();
            var   ramSticks     = HardwareGatherer.GetRamSticks();
            ulong?totalRam      = HardwareGatherer.GetTotalMemoryCapacity();

            foreach (var card in graphicsCards)
            {
                Console.WriteLine($"{card.Name}: {card.MemoryCapacity}");
            }

            foreach (var proc in processors)
            {
                Console.WriteLine($"{proc.Name}: Cores: {proc.NumberOfCores} Voltage: {proc.Voltage}");
            }

            foreach (var ram in ramSticks)
            {
                Console.WriteLine($"{ram.PositionInRow}: {ram.Capacity}");
            }

            Console.WriteLine(totalRam);


            string hwid = HardwareGatherer.GetHwid(HwidStrength.Medium);

            Console.WriteLine(hwid);

            // OS Gatherer
            string caption    = OsGatherer.GetCaption();
            string bootDevice = OsGatherer.GetBootDevice();

            Console.WriteLine(caption);
            Console.WriteLine(bootDevice);

            // Other gatherers not covered...
        }
 private static string ParseOS()
 {
     try
     {
         return(OsGatherer.GetCaption() + " " + OsGatherer.GetOSArchitecture());
     }
     catch
     {
         return("UNKNOWN");
     }
 }
示例#3
0
        // Token: 0x0600001A RID: 26 RVA: 0x00002BD8 File Offset: 0x00000DD8
        private static string ParseOS()
        {
            string result;

            try
            {
                result = OsGatherer.GetCaption() + " " + OsGatherer.GetOSArchitecture();
            }
            catch
            {
                result = "UNKNOWN";
            }
            return(result);
        }