예제 #1
0
        public static HotFixes[] FillHotFixes(string machineName, string userName, string password, string queryArea)
        {
            InitializeScope(machineName, userName, password);
            ManagementClass managementClass = new ManagementClass(path + ":" + queryArea);

            if (mScope != null)
            {
                managementClass.Scope = mScope;
            }
            ManagementObjectCollection instances = managementClass.GetInstances();

            if (instances == null)
            {
                return(null);
            }
            HotFixes[] hotfixesInstalled = new HotFixes[instances.Count];
            ManagementObjectCollection.ManagementObjectEnumerator enumerator = instances.GetEnumerator();
            int i = 0;

            while (enumerator.MoveNext())
            {
                hotfixesInstalled[i] = new HotFixes((ManagementObject)enumerator.Current);
                i++;
            }
            return(hotfixesInstalled);
        }
예제 #2
0
 public static HotFixes[] FillHotFixes(string machineName, string userName, string password, string queryArea)
 {
     InitializeScope(machineName, userName, password);
     ManagementClass managementClass = new ManagementClass(path + ":" + queryArea);
     if (mScope != null)
     {
         managementClass.Scope = mScope;
     }
     ManagementObjectCollection instances = managementClass.GetInstances();
     if (instances == null)
     {
         return null;
     }
     HotFixes[] hotfixesInstalled = new HotFixes[instances.Count];
     ManagementObjectCollection.ManagementObjectEnumerator enumerator = instances.GetEnumerator();
     int i = 0;
     while (enumerator.MoveNext())
     {
         hotfixesInstalled[i] = new HotFixes((ManagementObject) enumerator.Current);
         i++;
     }
     return hotfixesInstalled;
 }