示例#1
0
文件: RTX.cs 项目: 080779/myProject
 public void CreateRoot()
 {
     RootObj     = new RTXSAPILib.RTXSAPIRootObj();                                                                                            //创建根对象
     UserAuthObj = RootObj.UserAuthObj;                                                                                                        //通过根对象创建用户认证对象
     UserAuthObj.OnRecvUserAuthRequest += new _IRTXSAPIUserAuthObjEvents_OnRecvUserAuthRequestEventHandler(UserAuthObj_OnRecvUserAuthRequest); //订阅用户认证响应事件
     RootObj.ServerIP    = "127.0.0.1";
     RootObj.ServerPort  = Convert.ToInt16("8006");
     UserAuthObj.AppGUID = "{8E85315D-342C-417d-9093-57F824638040}"; //设置应用GUID
     UserAuthObj.AppName = "RTX_LDAP_LUGIN";                         //设置应用名
 }
示例#2
0
 public void CreateRoot()
 {
     //RTXSAPIRootObjClass RootObj = new RTXSAPIRootObjClass();  //创建根对象
     RootObj     = new RTXSAPILib.RTXSAPIRootObj();                                                                                            //创建根对象
     UserAuthObj = RootObj.UserAuthObj;                                                                                                        //通过根对象创建用户认证对象
     UserAuthObj.OnRecvUserAuthRequest += new _IRTXSAPIUserAuthObjEvents_OnRecvUserAuthRequestEventHandler(UserAuthObj_OnRecvUserAuthRequest); //订阅用户认证响应事件
     RootObj.ServerIP    = server;
     RootObj.ServerPort  = Convert.ToInt16(port);
     UserAuthObj.AppGUID = "{8E85315D-342B-417d-9093-57F824638040}"; //设置应用GUID
     UserAuthObj.AppName = "RTX_LDAP_SERVICE";                       //设置应用名
 }
示例#3
0
文件: frmAD.cs 项目: hxun/RTXLDAP
 public frmAD()
 {
     InitializeComponent();
     RootObj        = new RTXSAPIRootObj();
     DeptManagerObj = RootObj.DeptManager;
     UserManagerObj = RootObj.UserManager;
     UserAuthObj    = RootObj.UserAuthObj;
     UserAuthObj.OnRecvUserAuthRequest += new _IRTXSAPIUserAuthObjEvents_OnRecvUserAuthRequestEventHandler(UserAuthObj_OnRecvUserAuthRequest); //user auth event
     RootObj.ServerIP    = config.RTXIP;                                                                                                       //rtx ip
     RootObj.ServerPort  = config.RTXPort;                                                                                                     //rtx port
     UserAuthObj.AppGUID = config.AppGUID;                                                                                                     //app guid
     UserAuthObj.AppName = config.AppName;                                                                                                     //app name
     try
     {
         UserAuthObj.RegisterApp();      //register app
         UserAuthObj.StartApp("", 8);    //start app
     }
     catch (COMException ex)
     {
         MessageBox.Show(ex.Message);
         Application.Exit();
     }
     onLogin = new OnLogin(onUserLogin);
 }
示例#4
0
文件: frmAD.cs 项目: tangck/RTXLDAP
        RTXSAPILib.RTXSAPIUserManager UserManagerObj; //rtx user obj

        #endregion Fields

        #region Constructors

        public frmAD()
        {
            InitializeComponent();
            RootObj = new RTXSAPIRootObj();
            DeptManagerObj = RootObj.DeptManager;
            UserManagerObj = RootObj.UserManager;
            UserAuthObj = RootObj.UserAuthObj;
            UserAuthObj.OnRecvUserAuthRequest += new _IRTXSAPIUserAuthObjEvents_OnRecvUserAuthRequestEventHandler(UserAuthObj_OnRecvUserAuthRequest); //user auth event
            RootObj.ServerIP = config.RTXIP;        //rtx ip
            RootObj.ServerPort = config.RTXPort;    //rtx port
            UserAuthObj.AppGUID = config.AppGUID;   //app guid
            UserAuthObj.AppName = config.AppName;   //app name
            try
            {
                UserAuthObj.RegisterApp();      //register app
                UserAuthObj.StartApp("", 8);    //start app
            }
            catch (COMException ex)
            {
                MessageBox.Show(ex.Message);
                Application.Exit();
            }
            onLogin = new OnLogin(onUserLogin);
        }
示例#5
0
文件: MainWindow.cs 项目: GameSA/tale
        public MainWindow()
        {
            InitializeComponent();

            app_notify = new NotifyIcon();
            app_notify.Icon = new Icon(SystemIcons.Application, 40, 40);
            app_notify.Icon = (Icon)Properties.Resources.ResourceManager.GetObject("myappicon");
            app_notify.Visible = true;
            app_notify.DoubleClick += new EventHandler(NotifyIcon_DoubleClicked);

            notify_menu = new System.Windows.Forms.ContextMenu();
            MenuItem exit_item = new MenuItem("�˳�");
            notify_menu.MenuItems.Add(exit_item);
            exit_item.Click += new EventHandler(NotifyMenuExitItem_Clicked);

            app_notify.ContextMenu = notify_menu;

            //����������
            RootObj = new RTXSAPILib.RTXSAPIRootObj();
            //���÷�����IP
            RootObj.ServerIP = _ServerIP;
            //���÷������˿�
            RootObj.ServerPort = _ServerPort;

            //ͨ�������󴴽��û���֤����
            UserAuthObj = RootObj.UserAuthObj;
            //�����û���֤��Ӧ�¼�
            UserAuthObj.OnRecvUserAuthRequest += new _IRTXSAPIUserAuthObjEvents_OnRecvUserAuthRequestEventHandler(UserAuthObj_OnRecvUserAuthRequest);
            //����Ӧ��GUID
            UserAuthObj.AppGUID = _AppGUID;
            //����Ӧ����
            UserAuthObj.AppName = _AppName;

            UserManagerObj = RootObj.UserManager;
            DeptManagerObj = RootObj.DeptManager;
            OrgsManagerObj = ((RTXSAPIRootObj2)RootObj).OrgstructManager;

            updateAuthResult = new UpdateDisplayControl(AuthCompleted);
            updateSychResult = new UpdateDisplayControl(SychCompleted);

            try
            {
                //ע��Ӧ��
                this.authExecuteResultTxtBox.Text += DateTime.Now.ToString("yy-MM-dd HH:mm:ss") + "| ����ע��Ӧ��..." + Environment.NewLine;
                UserAuthObj.RegisterApp();
                this.authExecuteResultTxtBox.Text += DateTime.Now.ToString("yy-MM-dd HH:mm:ss") + "| Ӧ��ע��ɹ�..." + Environment.NewLine;
                //���Ӧ��
                this.authExecuteResultTxtBox.Text += DateTime.Now.ToString("yy-MM-dd HH:mm:ss") + "| �������Ӧ��..." + Environment.NewLine; ;
                UserAuthObj.StartApp("", 8);
                this.authExecuteResultTxtBox.Text += DateTime.Now.ToString("yy-MM-dd HH:mm:ss") + "| Ӧ������ɹ�..." + Environment.NewLine;

                // ���ͬ���߳�
                sychronThread = new Thread(new ThreadStart(AccountSychronization));
                sychronThread.Start();

                _AppRunning = true;
            }
            catch (COMException ex)
            {
                _AppRunning = false;
                this.authExecuteResultTxtBox.Text += ex.Message;
            }
        }
示例#6
0
        public MainWindow()
        {
            InitializeComponent();

            app_notify              = new NotifyIcon();
            app_notify.Icon         = new Icon(SystemIcons.Application, 40, 40);
            app_notify.Icon         = (Icon)Properties.Resources.ResourceManager.GetObject("myappicon");
            app_notify.Visible      = true;
            app_notify.DoubleClick += new EventHandler(NotifyIcon_DoubleClicked);

            notify_menu = new System.Windows.Forms.ContextMenu();
            MenuItem exit_item = new MenuItem("退出");

            notify_menu.MenuItems.Add(exit_item);
            exit_item.Click += new EventHandler(NotifyMenuExitItem_Clicked);

            app_notify.ContextMenu = notify_menu;

            //创建根对象
            RootObj = new RTXSAPILib.RTXSAPIRootObj();
            //设置服务器IP
            RootObj.ServerIP = _ServerIP;
            //设置服务器端口
            RootObj.ServerPort = _ServerPort;

            //通过根对象创建用户认证对象
            UserAuthObj = RootObj.UserAuthObj;
            //订阅用户认证响应事件
            UserAuthObj.OnRecvUserAuthRequest += new _IRTXSAPIUserAuthObjEvents_OnRecvUserAuthRequestEventHandler(UserAuthObj_OnRecvUserAuthRequest);
            //设置应用GUID
            UserAuthObj.AppGUID = _AppGUID;
            //设置应用名
            UserAuthObj.AppName = _AppName;

            UserManagerObj = RootObj.UserManager;
            DeptManagerObj = RootObj.DeptManager;
            OrgsManagerObj = ((RTXSAPIRootObj2)RootObj).OrgstructManager;

            updateAuthResult = new UpdateDisplayControl(AuthCompleted);
            updateSychResult = new UpdateDisplayControl(SychCompleted);

            try
            {
                //注册应用
                this.authExecuteResultTxtBox.Text += DateTime.Now.ToString("yy-MM-dd HH:mm:ss") + "| 正在注册应用..." + Environment.NewLine;
                UserAuthObj.RegisterApp();
                this.authExecuteResultTxtBox.Text += DateTime.Now.ToString("yy-MM-dd HH:mm:ss") + "| 应用注册成功..." + Environment.NewLine;
                //启动应用
                this.authExecuteResultTxtBox.Text += DateTime.Now.ToString("yy-MM-dd HH:mm:ss") + "| 正在启动应用..." + Environment.NewLine;;
                UserAuthObj.StartApp("", 8);
                this.authExecuteResultTxtBox.Text += DateTime.Now.ToString("yy-MM-dd HH:mm:ss") + "| 应用启动成功..." + Environment.NewLine;

                // 启动同步线程
                sychronThread = new Thread(new ThreadStart(AccountSychronization));
                sychronThread.Start();

                _AppRunning = true;
            }
            catch (COMException ex)
            {
                _AppRunning = false;
                this.authExecuteResultTxtBox.Text += ex.Message;
            }
        }