private static extern bool NET_DVR_SetDecInfo(Int32 lUserID, Int32 lChannel, ref HCNetSDK.NET_DVR_DECCFG lpDecoderinfo);
 private static extern Int32 NET_DVR_Login(string sDVRIP, ushort wDVRPort, string sUserName, string sPassword, ref HCNetSDK.NET_DVR_DEVICEINFO lpDeviceInfo);
 private static extern Int32 NET_DVR_PlayBackByTime(Int32 lUserID, Int32 lChannel, ref HCNetSDK.NET_DVR_TIME lpStartTime, ref HCNetSDK.NET_DVR_TIME lpStopTime, IntPtr hWnd);
 private static extern Int32 NET_DVR_GetFileByTime(Int32 lUserID, Int32 lChannel, ref HCNetSDK.NET_DVR_TIME lpStartTime, ref HCNetSDK.NET_DVR_TIME lpStopTime, StringBuilder sSavedFileName);
 private static extern bool NET_DVR_GetPlayBackOsdTime(Int32 lPlayHandle, ref HCNetSDK.NET_DVR_TIME lpOsdTime);
        /// <summary>
        /// 压缩参数初始化.
        /// </summary>
        /// <param name="inf">压缩配置.</param>
        private void compressionCfgInit(HCNetSDK.NET_DVR_COMPRESSION_INFO_EX inf)
        {
            CBox_StreamType.SelectedIndex = inf.byStreamType;       // 码流类型

            CBox_VideoQuality.SelectedIndex = inf.byPicQuality;         // 图像质量

            if (isRecord)
                CBox_Resolution.SelectedIndex = inf.byResolution;           // 分辨率
            else
            {
                try
                {
                    CBox_Resolution.SelectedIndex = inf.byResolution - 1;           // 分辨率
                }
                catch (System.Exception e)
                {

                }
            }

            //视频码率
            if (inf.dwVideoBitrate < 24)
            {
                CBox_BitRate.SelectedIndex = inf.dwVideoBitrate-2;
            }
            else
            {
                CBox_BitRate.SelectedIndex = 22;
                TBox_BitRate.Text = inf.dwVideoBitrate.ToString();
            }

            CBox_VideoFrameRate.SelectedIndex = inf.dwVideoFrameRate;  // 视频帧率
            CBox_BitRateType.SelectedIndex = inf.byBitrateType;                   // 码率类型
        }
 private static extern bool NET_DVR_CaptureJPEGPicture(Int32 lUserID, Int32 lChannel, ref HCNetSDK.NET_DVR_JPEGPARA lpJpegPara, StringBuilder sPicFileName);
 private static extern Int32 NET_DVR_FindNextLog(Int32 lLogHandle, ref HCNetSDK.NET_DVR_LOG lpLogData);
 private static extern bool NET_DVR_GetAlarmOut(Int32 lUserID, ref HCNetSDK.NET_DVR_ALARMOUTSTATUS lpAlarmOutState);
 private static extern Int32 NET_DVR_FindFileByCard(Int32 lUserID, Int32 lChannel, int dwFileType, bool bNeedCardNum, out byte[] sCardNumber, ref HCNetSDK.NET_DVR_TIME lpStartTime, ref HCNetSDK.NET_DVR_TIME lpStopTime);
 private static extern Int32 NET_DVR_FindNextFile(Int32 lFindHandle, ref HCNetSDK.NET_DVR_FIND_DATA lpFindData);
 private static extern Int32 NET_DVR_FindFile(Int32 lUserID, Int32 lChannel, int dwFileType, ref HCNetSDK.NET_DVR_TIME lpStartTime, ref HCNetSDK.NET_DVR_TIME lpStopTime);
 private static extern Int32 NET_DVR_FindDVRLog(Int32 lUserID, Int32 lSelectMode, int dwMajorType, int dwMinorType, ref HCNetSDK.NET_DVR_TIME lpStartTime, ref HCNetSDK.NET_DVR_TIME lpStopTime);
 private static extern bool NET_DVR_DecPlayBackCtrl(Int32 lUserID, Int32 lChannel, Int32 dwControlCode, Int32 dwInValue, ref Int32 lpOutValue, ref HCNetSDK.NET_DVR_PLAYREMOTEFILE lpRemoteFileInfo);
 private static extern bool NET_DVR_SetDecTransPort(Int32 lUserID, ref HCNetSDK.NET_DVR_PORTCFG lpTransPort);
 private static extern bool NET_DVR_GetDecCurLinkStatus(Int32 lUserID, Int32 lChannel, ref HCNetSDK.NET_DVR_DECSTATUS lpDecStatus);
 private static extern bool NET_DVR_StopDecSpecialCon(Int32 lUserID, Int32 lChannel, ref HCNetSDK.NET_DVR_DECCHANINFO lpDecChanInfo);
 private static extern bool NET_DVR_GetDVRWorkState(Int32 lUserID, ref HCNetSDK.NET_DVR_WORKSTATE lpWorkState);
        /// <summary>
        /// 获取压缩配置参数信息.
        /// </summary>
        /// <param name="inf">The inf.</param>
        private void getCompressionCfg(HCNetSDK.NET_DVR_COMPRESSION_INFO_EX inf)
        {
            inf.byBitrateType = (byte)CBox_BitRateType.SelectedIndex;  //码率类型

            //视频码率
            if (CBox_BitRate.SelectedIndex == 22)
            {
                if(string.IsNullOrEmpty(TBox_BitRate.Text))
                    TBox_BitRate.Text = "0";

                int tem = int.Parse(TBox_BitRate.Text);

                if (tem<32 || tem>8192)
                {
                    MessageBox.Show("自定义视频码率范围为32 -- 8192 kpbs","超出范围",MessageBoxButtons.OK);
                    return;
                }

                inf.dwVideoBitrate = tem;//int.Parse(TBox_BitRate.Text);
            }
            else
                inf.dwVideoBitrate = CBox_BitRate.SelectedIndex+2;

            inf.byStreamType = (byte)CBox_StreamType.SelectedIndex;   // 码流类型

            if(isRecord)
                inf.byResolution = (byte)CBox_Resolution.SelectedIndex;       // 分辨率
            else
                inf.byResolution = (byte)(CBox_Resolution.SelectedIndex+1);       // 分辨率

            inf.byPicQuality = (byte)CBox_VideoQuality.SelectedIndex;    // 图像质量

            inf.dwVideoFrameRate = CBox_VideoFrameRate.SelectedIndex;  // 视频帧率
        }
 internal static extern Int32 NET_DVR_RealPlay(Int32 lUserID, ref HCNetSDK.NET_DVR_CLIENTINFO lpClientInfo);