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

  • 相关阅读:
    js 右击
    javascript 中的函数,控制流, 事件委托
    javascript 的 this , js 线程
    javascript 中的var : 隐含变量 全局变量 变量提升
    明日
    ajax循环json 中的 for(var prop in data) 与 hasProperty()
    js继承机制
    callee, caller,toString(),String()
    解决eclipse中jsp下无代码提示问题
    商业模式
  • 原文地址:https://www.cnblogs.com/teyond/p/SoundDevice.html
Copyright © 2011-2022 走看看