Exemple #1
0
 public bool Open()
 {
     try
     {
         int ret = -1;
         if (!HCNetSDK.NET_DVR_Init())
         {
             return(false);
         }
         _user_id = HCNetSDK.NET_DVR_Login_V30(_ip, _port, _user_name, _password, out deviceInfo);
         if (_user_id < 0)
         {
             return(false);
         }
         _dec_handle = HCNetSDK.NET_DVR_InitG722Encoder();
         // 增加消息处理时间
         if (MessageReceived != null)
         {
             IntPtr pUser = new IntPtr();
             bool   bRet  = HCNetSDK.NET_DVR_SetDVRMessageCallBack_V30(MessageReceived, pUser);
             _alarm_handle = HCNetSDK.NET_DVR_SetupAlarmChan_V30(_user_id);
         }
         return(true);
     }
     catch (Exception ex)
     {
         WriteLog("硬盘录像机打开失败:" + ex.Message);
         return(false);
     }
 }
Exemple #2
0
        public bool Open()
        {
            int ret = -1;

            if (!SDK_Init())
            {
                return(false);
            }
            ret = SDK_Login(_ip, _port, _user_name, _password);
            if (ret < 0)
            {
                return(false);
            }
            _dec_handle = HCNetSDK.NET_DVR_InitG722Encoder();
            return(true);
        }