示例#1
0
        /*******************************************************/
        /// <summary>
        /// 读取配合文件ini的回调函数
        /// </summary>
        /// <param name="_sCallBackData">读取的key值和value(json字符串)</param>
        public void ReadIniCallBack(string _sCallBackData)
        {
            JObject jObject = JObject.Parse(_sCallBackData);

            if (jObject.Count > 0)
            {
                foreach (var Obj in jObject)
                {
                    //读取的抓拍路径
                    if (Obj.Key == "CapPicPath")
                    {
                        JToken jToken = Obj.Value;
                        m_sCapPicPath = jToken.Value <string>();
                        if (m_sCapPicPath != "")
                        {
                            ucVGSHow.SetCapturePath(m_sCapPicPath, true);
                        }
                    }
                    //读取的VsClient.dll的路径,并初始化动态库
                    else if (Obj.Key == "VsClientPath")
                    {
                        JToken jToken = Obj.Value;
                        m_sVsClientPath = jToken.Value <string>();
                        if (m_sVsClientPath != "")
                        {
                            if (!m_bIsInitSelfSucc)
                            {
                                //加载自己的api库
                                if (VsClientAPI.LoadVsClientAPI(m_sVsClientPath))
                                {
                                    VsClientAPI.VSSP_ClientStartup(DefIcomClient.WM_VSCLIENT_DLL_MSG, this.Handle, m_MsgCallBack);
                                    VsClientAPI.VSSP_ClientWaitTime(2, 2);
                                    m_bIsInitSelfSucc = true;
                                }
                            }
                        }
                    }
                    //读取HCNetSDK.dll的路径,并初始化动态库
                    else if (Obj.Key == "HikSDKPath")
                    {
                        JToken jToken = Obj.Value;
                        m_sHCNetSDKPath = jToken.Value <string>();
                        //设置海康的环境变量
                        //string sPath = m_sHCNetSDKPath.Replace("\\\\", "\\");
                        System.Environment.SetEnvironmentVariable("HDCNETSDK", m_sHCNetSDKPath);
                    }
                }
            }
        }
示例#2
0
        /// <summary>
        /// 读取配合文件ini的回调函数
        /// </summary>
        /// <param name="_sCallBackData">读取的key值和value(json字符串)</param>
        public void ReadIniCallBack(string _sCallBackData)
        {
            JObject jObject = JObject.Parse(_sCallBackData);

            if (jObject.Count > 0)
            {
                foreach (var Obj in jObject)
                {
                    //读取的VsClient.dll的路径,并初始化动态库
                    if (Obj.Key == "VsClientPath")
                    {
                        JToken jToken = Obj.Value;
                        m_sVsClientPath = jToken.Value <string>();
                        if (m_sVsClientPath != "")
                        {
                            //加载自己的api库
                            if (VsClientAPI.LoadVsClientAPI(m_sVsClientPath))
                            {
                                VsClientAPI.VSSP_ClientStartup(DefIcomClient.WM_VSCLIENT_DLL_MSG, this.Handle, m_MsgCallBackSelf);
                                VsClientAPI.VSSP_ClientWaitTime(2, 2);
                            }
                        }
                    }
                    //读取HCNetSDK.dll的路径,并初始化动态库
                    else if (Obj.Key == "HikSDKPath")
                    {
                        JToken jToken = Obj.Value;
                        m_sHCNetSDKPath = jToken.Value <string>();
                        //设置海康的环境变量
                        System.Environment.SetEnvironmentVariable("HDCNETSDK_BETHVIDEO", m_sHCNetSDKPath);
                        //初始化海康sdk
                        if (CHCNetSDK.NET_DVR_Init())
                        {
                            CHCNetSDK.NET_DVR_SetDVRMessageCallBack_V31(m_MsgCallback, IntPtr.Zero);
                        }
                    }
                }
            }
        }