Пример #1
0
 public void Clear(ReconCOM rc, string userName)
 {
     //rc.CS_Login(userName, userName);
     //add by lihf 2014-2-18
     rc.CS_Login(LoginUser.AgentNum, LoginUser.AgentNum);
     AgentLogOff(rc, userName);
     rc.CS_Logout();
 }
Пример #2
0
 public bool execute(ReconCOM rc, String[] argv)
 {
     try
     {
         int    iRet;
         String username = argv.Length > 1 ? argv[1] : "System";
         String password = argv.Length > 2 ? argv[2] : "carols";
         iRet = rc.CS_Login(username, password);
         if (iRet == (int)enErrorCode.E_SUCCESS)
         {
             System.Console.WriteLine("MyComponentID:" + rc.CM_GetMyComponentID());
             return(true);
         }
         System.Console.WriteLine();
         System.Console.WriteLine((enErrorCode)iRet);
         return(false);
     }
     catch (Exception ex)
     {
         System.Console.WriteLine("Exception: ", ex + " - " + ex.Message);
         return(false);
     }
 }
Пример #3
0
        public int Login(ReconCOM rc, string username, bool IsBindRecord)
        {
            Loger.Log4Net.Info("[CarolHelper]Login(ReconCOM rc, string username, bool IsBindRecord) begin...");
            string msg  = string.Empty;
            int    iRet = -1;

            try
            {
                //iRet = rc.CS_Login(username, username);
                //add by lihf 2014-2-18
                iRet = rc.CS_Login(LoginUser.AgentNum, LoginUser.AgentNum);
                if (iRet == (int)enErrorCode.E_SUCCESS)
                {
                    Loger.Log4Net.Info("[CarolHelper]Login->rc.CS_Login(username, username)...E_SUCCESS...");
                    iRet = rc.T_StartMonitor(username, 1);
                    if (iRet == (int)enErrorCode.E_SUCCESS)
                    {
                        //iRet = rc.T_AgentLogOn(username, username, username, 0);
                        iRet = AgentLogOn(rc, username, "");
                        if (iRet == (int)enErrorCode.E_SUCCESS)
                        {
                            if (IsBindRecord)
                            {
                                if (VCLogServiceHelper.Instance.AgentLogin(username, username, ref msg) &&
                                    VCLogServiceHelper.Instance.StartRecord(username, string.Empty, ref msg))
                                {
                                    iRet = (int)enErrorCode.E_SUCCESS;
                                }
                                else
                                {
                                    iRet = -1;//宇高录音登录失败
                                    //rc.T_AgentLogOff(username, username);
                                    //add by lihf 2014-2-18
                                    rc.T_AgentLogOff(username, LoginUser.AgentNum);
                                    rc.CS_Logout();
                                    //rc.R_Close();
                                }
                            }
                        }
                        else
                        {
                            Loger.Log4Net.Info("[CarolHelper]Login->rc.CS_Login-AgentLogOn...失败...iRet is:" + iRet);
                            rc.CS_Logout();
                        }
                    }
                    else
                    {
                        Loger.Log4Net.Info("[CarolHelper]Login->rc.CS_Login-T_StartMonitor(username, 1)...失败...iRet is:" + iRet);
                        rc.CS_Logout();
                    }
                }
                else
                {
                    Loger.Log4Net.Info("[CarolHelper]Login->rc.CS_Login(username, username)...NOTSUCCESS...iRET IS:" + iRet);
                }
                //System.Console.WriteLine();
                //System.Console.WriteLine((enErrorCode)iRet);
                return(iRet);
            }
            catch (Exception ex)
            {
                System.Console.WriteLine("Exception: ", ex + " - " + ex.Message);
                Loger.Log4Net.Info("[CarolHelper]Login...errorMessage is:" + ex.Message);
                Loger.Log4Net.Info("[CarolHelper]Login...errorSource is:" + ex.Source);
                Loger.Log4Net.Info("[CarolHelper]Login...errorStackTrace is:" + ex.StackTrace);
            }
            return(iRet);
        }