从注册表中查询某一键值对

来源:互联网 发布:淘宝去广告 编辑:程序博客网 时间:2024/04/28 18:35

本例已好视通为例,使用winform调用webserver接口后直接加入会议代码

Microsoft.Win32.RegistryKey regKey = null;

            Microsoft.Win32.RegistryKey regSubKey = null;
            try
            {

                regKey = Microsoft.Win32.Registry.CurrentUser;

              //目录

                regSubKey = regKey.OpenSubKey(@"Software\Fastonz\FMDesktop\", false);

               

              //查找某一键值

               string objResult = regSubKey.GetValue("FilePath", "").ToString();

                
                if (!String.IsNullOrEmpty(objResult))
                {
                    string meetingargument = " -rid " + roomid + " -uname "+textBox1.Text+" -utype 0 -link TCP:fsmeeting.com:1089";
                    //通过在进程名后面添加命令行参数的方法,启动好视通客户端

                    System.Diagnostics.Process p = new System.Diagnostics.Process();

                   //如果这里使用p.StartInfo. 的方式设置有可能无法直接进入会议,只能进入登陆页

                    System.Diagnostics.ProcessStartInfo startInfor = new System.Diagnostics.ProcessStartInfo(objResult,
                        meetingargument);
                    p.StartInfo = startInfor;
                    p.Start();

                }
0 0
原创粉丝点击