zoukankan      html  css  js  c++  java
  • 查看系统声卡信息


            #region 声卡信息
            /// <summary>
            /// 获取声卡信息
            /// </summary>
            private void GetSoundDeviceProperties()
            {
                try
                {
                    ObjectGetOptions options = new ObjectGetOptions(null, TimeSpan.MaxValue, true);
                    ManagementClass class2 = new ManagementClass("root\CIMV2", "Win32_SoundDevice", options);
                    class2.Options.UseAmendedQualifiers = true;
                    ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\CIMV2", "SELECT * FROM Win32_SoundDevice");
                    Console.WriteLine("-----------------------------------");
                    Console.WriteLine("Win32_SoundDevice instance");
                    Console.WriteLine("-----------------------------------");
                    foreach (PropertyData data in class2.Properties)
                    {
                        string str = data.Name;
                        foreach (ManagementObject queryObj in searcher.Get())
                        {
                            Console.WriteLine(string.Format("{0}:{1}", str, queryObj[str]));
                        }
                    }
                }
                catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.StackTrace + ":" + ex.Message); }
            }

            #endregion

  • 相关阅读:
    bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
    CentOS 7下MySQL安装配置
    CentOS 7下设置DNS服务器
    MySQL Table is marked as crashed 解决方法
    supervisor使用
    Linux更改服务器Hostname
    在Linux中让打印带颜色的字
    php安装gearman扩展实现异步分步式任务
    GitLab的Gravatar头像服务不可用
    Nginx + tornado + supervisor部署
  • 原文地址:https://www.cnblogs.com/teyond/p/SoundDevice.html
Copyright © 2011-2022 走看看