예제 #1
0
        void QueryNamespaces()
        {
            FormSplash.ShowForm("Searching for WMI Namespaces... Please, wait");

            RecurseNamespaces("root", treeNS.Nodes.Add("root", "root", 1, 2).Nodes);
            treeNS.Nodes[0].Expand();

            xDoc = new XDocument(new XElement("root"));
            AddXNodeRecursive(xDoc.Root, treeNS.Nodes[0]);
            SaveNamespacesTree();
            FormSplash.CloseForm();
        }
예제 #2
0
 void GetClasses(string ns)
 {
     FormSplash.ShowForm("Searching for WMI Classes... Please, wait");
     try
     {
         ManagementObjectSearcher searcher = new ManagementObjectSearcher(
             new ManagementScope(ns),
             new SelectQuery("meta_class"), null);
         foreach (ManagementClass c in searcher.Get())
         {
             string name = c["__CLASS"].ToString();
             nClasses++;
             AddClass(name, c);
             FormSplash.AddItem(name);
         }
     }
     catch (Exception e) { SetError(e.Message, ns); }
     FormSplash.CloseForm();
 }