Esempio n. 1
0
        public void PropertyValueParse()
        {
            WMIData      wmiData = new WMIData();
            WMIProcessor wmi     = new WMIProcessor(WMI_ALIAS.CPU, "name");
            Dictionary <String, String> result = wmiData.AssertParseWMIOutput(wmi.ExecuteRequest());

            Assert.AreEqual("Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz", result["name"]);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            // Request WMI data from a remote machine.
            WMIProcessor wmi = new WMIProcessor();

            wmi.Request       = WMI_ALIAS.CPU;
            wmi.Filter        = "name,threadcount,architecture";
            wmi.RemoteExecute = true;
            wmi.NodeName      = "10.1.2.8";
            Console.WriteLine(wmi.ExecuteRequest());

            Console.WriteLine();

            // Change RemoteExecute to false. Executes query on local machine.
            wmi.RemoteExecute = false;
            Console.WriteLine(wmi.ExecuteRequest());

            Console.WriteLine();

            // WMIData object with default request + Extra Request.
            WMIData wmiData = new WMIData(true);

            wmiData.GetData(WMI_ALIAS.NETWORK_INTERFACE_CARD_CONFIG, "ipaddress");

            foreach (var currentAlias in wmiData.Properties)
            {
                Console.WriteLine(currentAlias.Key.Value);
                foreach (var currentProperty in wmiData.Properties[currentAlias.Key])
                {
                    Console.WriteLine("{0} : {1}", currentProperty.Key, currentProperty.Value);
                }
                Console.WriteLine();
            }

            Console.ReadKey();
        }
Esempio n. 3
0
        public void GetOSCaption()
        {
            WMIProcessor wmi = new WMIProcessor(WMI_ALIAS.OPERATING_SYSTEM, "caption", false);

            Assert.AreEqual("Caption=Microsoft Windows 10 Enterprise", wmi.ExecuteRequest());
        }
Esempio n. 4
0
        public void ExecuteTask()
        {
            WMIProcessor wmip = new WMIProcessor(WMI_ALIAS.OPERATING_SYSTEM);

            Assert.IsNotNull(wmip.ExecuteRequest());
        }