Пример #1
0
 private void procRelogin()
 {
     try
     {
         //封装
         int ret = BVCU.ManagedLayer_CuLogin(m_bvsdkHandle,
                                             ref m_server.sessionHandle, Encoding.UTF8.GetBytes(m_server.ip),
                                             m_server.port, Encoding.UTF8.GetBytes(m_server.usrName),
                                             Encoding.UTF8.GetBytes(m_server.psw), SERVER_TIME_OUT_SECOND,
                                             m_bvsdkEventHandler.server_OnEvent, m_bvsdkEventHandler.server_ProcChannelInfo);
         m_iLoginRetryCount++;
         Console.WriteLine("服务器断线重连执行第{0}次", m_iLoginRetryCount);
         if (m_iLoginRetryCount >= m_ServerRetryTimes)
         {
             Console.WriteLine("注销断线重连timer");
             releaseReloginTimer();
             return;
         }
     }
     catch
     {
         MessageBox.Show("登录失败");
     }
 }
Пример #2
0
        public void login(string ip, int port, string usrName, string psw)
        {
            m_server.ip       = ip;
            m_server.port     = port;
            m_server.usrName  = usrName;
            m_server.psw      = psw;
            m_server.ukeyid   = "";
            m_server.ukeycode = "";
            try
            {
                //封装
                int ret = BVCU.ManagedLayer_CuLogin(m_bvsdkHandle,
                                                    ref m_server.sessionHandle, Encoding.UTF8.GetBytes(ip),
                                                    port, Encoding.UTF8.GetBytes(usrName),
                                                    Encoding.UTF8.GetBytes(psw), SERVER_TIME_OUT_SECOND,
                                                    m_bvsdkEventHandler.server_OnEvent, m_bvsdkEventHandler.server_ProcChannelInfo);

                BVCU.FAILED(ret);
            }
            catch
            {
                MessageBox.Show("登录失败");
            }
        }