コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="user"></param>
        /// <param name="pass"></param>
        /// <param name="ip"></param>
        /// <param name="port"></param>
        /// <param name="type"></param>
        /// <exception cref="ArgumentException">传入参数格式异常</exception>
        /// <returns></returns>
        public bool Login(string userName, string password, string ip, ushort port, uint timeout, uint userData)
        {
            bool bRet = false;

            if (IR_SDK.IR_SetLoginCmdInfo(userName))
            {
                int    loginType = 2;                                                                                               // Framework.Environment.LoginType;			//登录类型(直连服务器or管理服务器)
                string serverIP  = Framework.Environment.ServerIP;                                                                  //IP地址
                string user      = IR_SDK.IR_GetIDFromAuthToken(Framework.Environment.IR_APP_ID, Framework.Environment.IR_APP_KEY); //用户名
                // string userName = null;
                //if (string.IsNullOrEmpty(userName))
                //{
                //    userName = "******";
                //}
                if (!string.IsNullOrEmpty(userName))
                {
                    password = "******";      //高级权限通用密码
                    bRet     = m_AuthenticationService.Login(userName, password, ip, port, timeout, userData);
                    if (bRet)
                    {
                        IR_SDK.StartHeartbeat();
                    }
                }
            }
            else
            {
                throw new ArgumentException();
            }

            return(bRet);
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="hrItem"></param>
        /// <param name="progress">-1标示下载失败,100标示下载完成</param>
        public void UpdateProgress(int hrItem, int progress)
        {
            if (downloadFileList.ContainsKey(hrItem))
            {
                DownloadItemInfo info = downloadFileList[hrItem];
                info.progress = progress;
                form.UpdateDownloadProgress(hrItem, progress);
                if (Framework.Environment.PRODUCT_TYPE == Framework.Environment.E_PRODUCT_TYPE.SH_PRODUCT)
                {
                    if (progress == 100)
                    {
                        string filename = info.downloadPath + "\\" + info.dstName;
                        int    type     = 0;
                        switch (info.type)
                        {
                        case DownloadType.视频截图:
                        case DownloadType.结果图片:
                            type = 1026;
                            break;

                        case DownloadType.浓缩导出:
                        case DownloadType.视频剪辑:
                            type = 1036;
                            break;
                        }
                        IR_SDK.IR_UploadVideoFile(filename, type);
                        MyLog4Net.Container.Instance.Log.Debug("IR_UploadVideoFile:" + filename + " type:" + type);
                    }
                }
            }
        }
コード例 #3
0
        public bool Logout()
        {
            bool bRet = true;

            IR_SDK.StopHeartbeat();

            return(bRet);
        }