📜  c# 列出音频设备 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:55.340000             🧑  作者: Mango

代码示例1
ManagementObjectSearcher objSearcher = new ManagementObjectSearcher(
           "SELECT * FROM Win32_SoundDevice");

    ManagementObjectCollection objCollection = objSearcher.Get();

    foreach (ManagementObject obj in objCollection)
    {
        foreach (PropertyData property in obj.Properties)
        {
            Console.Out.WriteLine(String.Format("{0}:{1}", property.Name, property.Value));
        }
    }