WMI

とあるデバイスの情報が取りたくっていろいろググってたら発見した機能 Windowsが管理している様々な情報にアクセスできる便利API Windows Management Instrumentation - Wikipedia

対象を選択して、getPropertyメソッドで欲しい情報を取得する。 プロパティのキーについては下記のサイトが参考になる。

www.wmifun.net

サンプルコード

using System;
using System.Management;

namespace Project1
{
    class Class1
    {
        private const string QUERY = "Win32_SoundDevice";

        public static void Main(string[] args)
        {
            Class1 c = new Class1();
            c.getAudioDevice();
        }

        private void getAudioDevice()
        {
            Console.WriteLine("Start");
            ManagementObjectSearcher searcher = new ManagementObjectSearcher("select * from " + QUERY);
            foreach (ManagementObject soundDevice in searcher.Get())
            {
                try
                {
                    Console.WriteLine("Name is {0}", soundDevice.GetPropertyValue("Name"));
                    Console.WriteLine("ProductName is {0}", soundDevice.GetPropertyValue("ProductName"));
                    Console.WriteLine("DeviceID is {0}", soundDevice.GetPropertyValue("DeviceID"));
                    Console.WriteLine("Manufacturer is {0}", soundDevice.GetPropertyValue("Manufacturer"));
                    Console.WriteLine("SystemName is {0}", soundDevice.GetPropertyValue("SystemName"));
                }
                catch (Exception)
                {

                }
            }
            Console.ReadLine();
        }
    }
}