Esempio n. 1
0
        public static void OpenApp(AppType appType)
        {
            try
            {
                switch (appType)
                {
                case AppType.IE:
                    RegeditManage.OpenAplicationByRegedit2("IEXPLORE.EXE");
                    break;

                case AppType.Notepad:
                    ProcessManage.OpenAppByAppName("notepad.exe");
                    break;

                case AppType.calc:
                    ProcessManage.OpenAppByAppName("calc.exe");
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(typeof(ApplicationManage), ex);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 共享浏览器
        /// </summary>
        /// <param name="uri"></param>
        public void ShareWebBrowser(Uri uri)
        {
            try
            {
                RegeditManage.OpenAplicationByRegedit2("IEXPLORE.EXE", uri.OriginalString, new Action <int, IntPtr>((processID, intptr) =>
                {
                    //获取共享模型
                    var shareModality = ((ApplicationSharingModality)(LyncHelper.MainConversation.Conversation.Modalities[ModalityTypes.ApplicationSharing]));

                    //遍历可以共享的资源
                    foreach (var item in shareModality.ShareableResources)
                    {
                        //指定要共享的程序名称
                        if (item.Id.Equals(processID))
                        {
                            //判断是否可以进行共享该程序
                            if (shareModality.CanShare(item.Type))
                            {
                                this.ShareAndSync(intptr, shareModality, item);
                                break;
                            }
                        }
                        else if (item.Id == intptr.ToInt32())
                        {
                            //判断是否可以进行共享该程序
                            if (shareModality.CanShare(item.Type))
                            {
                                this.ShareAndSync(intptr, shareModality, item);
                                break;
                            }
                        }
                        //else if (item.Name.Contains(""))
                        //{

                        //    //判断是否可以进行共享该程序
                        //    if (shareModality.CanShare(item.Type))
                        //    {
                        //        共享程序置顶
                        //        Win32API.SetWindowPos(intptr, -1, 615, 110, 0, 0, 1 | 2);

                        //        //开始共享该程序
                        //        shareModality.BeginShareResources(item, null, null);
                        //        //同步页面
                        //        Conference.MainWindow.MainPageInstance.ChairView.SyncPageHelper(ConferenceCommon.EnumHelper.ViewSelectedItemEnum.Resource);
                        //        break;
                        //    }
                        //}
                    }
                }));
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 登录初始化配置(lync相关)
        /// </summary>
        private void LoginEnviromentInit_Lync()
        {
            try
            {
                //关闭指定后台进程
                ProcessManage.KillProcess("Lync");
                //lync临时显示
                WindowHide.SetTrayIconAllDsiplay("Lync");
                //消除死亡托盘图标
                SysTray.Refresh();
                //判断当前进程是否为单例
                ProcessManage.CheckCurrentProcessIsSingleInstance(new Action(() =>
                {
                    MessageBox.Show("该程序已经在运行中", "操作提示", MessageBoxButton.OK, MessageBoxImage.Information);
                    //关闭程序
                    Application.Current.Shutdown(0);
                }));

                //更改lync注册表
                RegeditManage.UpdateLyncRegedit();

                //获取lync进程
                Process[] processs = Process.GetProcessesByName("Lync");
                if (processs.Count() > 0)
                {
                    //清除lyncApp缓存文件
                    LyncManage.ClearLyncAppData();
                }

                //打开lync实例
                RegeditManage.OpenAplicationByRegedit2("Lync.exe");

                //程序退出时释放lync实例
                Application.Current.Exit += Current_Exit;

                #region old solution

                //验证是否能够访问AD  (adpppds)
                //if (!DetectionManage.TestNetConnectity(Constant.TreeServiceIP))
                //{
                //    MessageBox.Show("服务器连接失败,请及时联系管理员", "操作提示", MessageBoxButton.OK, MessageBoxImage.Information);
                //    //关闭程序
                //    Application.Current.Shutdown(0);
                //}



                ////关闭指定后台进程
                //ProcessManage.KillProcess("Lync");

                ////lync临时显示
                //WindowHide.SetTrayIconAllDsiplay("Lync");

                #endregion
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 环境配置2(获取会议信息,持久层信息绑定【config】)
        /// </summary>
        public void LoginEnviromentInit3()
        {
            try
            {
                if (DetectionManage.TestNetConnectity(Constant.TreeServiceIP))
                {
                    //验证是否能够访问LYNC扩展web服务(研讨服务)
                    if (DetectionManage.IsWebServiceAvaiable(Constant.TreeServiceAddressFront + Constant.ConferenceTreeServiceWebName))
                    {
                        if (CheckLoginInitCompleatetimer != null)
                        {
                            this.CheckLoginInitCompleatetimer.Stop();
                            this.CheckLoginInitCompleatetimer = null;
                        }
                        //获取客户端配置信息
                        ModelManage.ConferenceInfo.GetClientAppConfig(new Action <bool, ConferenceModel.ConferenceInfoWebService.ClientConfigEntity>((successed, result) =>
                        {
                            if (successed)
                            {
                                #region 配置本地环境

                                //客户端配置信息加载
                                this.AppconfigSetting(result);
                                //客户端配置信息加载2
                                this.AppconfigSetting2(result);

                                #region old solution

                                ////防火墙规则添加(研讨客户端)
                                //FireManage.OpenFireWall(Constant.FireName_Conference, Constant.ApplicationFullName);
                                ////防火墙规则添加(版本更新)
                                //FireManage.OpenFireWall(Constant.FireName_ConferenceUpdate, Constant.ConferenceVersionUpdateExe);

                                ////验证并安装lync相关证书
                                //CertificationManage.SetUpCertification(Constant.CertificationSerial, Constant.Certification);

                                //检测并开启rpc本地服务
                                //LocalServiceManage.CheckRunRpcService();

                                //设置证书(不检查发行商的证书是否吊销,不检查服务器证书吊销)
                                //RegeditManage.SetNoCheckCertificationIsRevoke();

                                //指定webbrowser版本(9.0)
                                //RegeditManage.SetWebBrowserVersion(Constant.ApplicationSingleName);

                                #endregion

                                //设置DNS
                                NetWorkAdapter.SetNetworkAdapter(Constant.DNS1);
                                //更改lync注册表
                                RegeditManage.UpdateLyncRegedit();
                                //确保PainFramework.dll存在系统目录
                                FileManage.CheckDebugHasTheFile(Constant.PaintFileName, Constant.PaintFileRoot);

                                #endregion

                                //获取信息成功
                                GetClientAppConfigSuccessedDealWidth();
                            }
                        }));
                    }
                }
                else
                {
                    //获取信息失败
                    GetClientAppConfigFailedDealWidth();
                }
            }
            catch (Exception ex)
            {
                LogManage.WriteLog(this.GetType(), ex);
            }
            finally
            {
            }
        }