public static SoundCard[] FillSoundCard(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); } SoundCard[] soundCard = new SoundCard[instances.Count]; ManagementObjectCollection.ManagementObjectEnumerator enumerator = instances.GetEnumerator(); int i = 0; while (enumerator.MoveNext()) { soundCard[i] = new SoundCard((ManagementObject)enumerator.Current); i++; } return(soundCard); }
public static SoundCard[] FillSoundCard(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; } SoundCard[] soundCard = new SoundCard[instances.Count]; ManagementObjectCollection.ManagementObjectEnumerator enumerator = instances.GetEnumerator(); int i = 0; while (enumerator.MoveNext()) { soundCard[i] = new SoundCard((ManagementObject) enumerator.Current); i++; } return soundCard; }