/// <summary>
        /// 功能:启动图像实时预览
        /// </summary>
        /// <param name="IUserId">用户登录ID,DeviceLogin 的返回值.</param>
        /// <param name="lChannel">硬盘录像机通道号</param>
        /// <param name="stringbsFileName">文件名</param>
        /// <returns>返回值:-1 表示失败,其他值作为其它函数的参数</returns>
        public int SaveNoRealData(int IUserId, int lChannel,string stringbsFileName)
        {
            CHANNEL_CLIENTINFO m_pChaninfo = new CHANNEL_CLIENTINFO();
            m_pChaninfo.m_channelID = (byte)(lChannel - 1);
            m_pChaninfo.m_buffnum = 50;
            m_pChaninfo.m_hVideoWnd = IntPtr.Zero;
            m_pChaninfo.m_streamType = 0;
            m_pChaninfo.m_tranType = 1;
            m_pChaninfo.m_streamType = 0;
            m_pChaninfo.m_startplay = false;
            m_pChaninfo.m_sFilename = stringbsFileName;

            string m_url = "";

            ILoginData loginData = loginDataList.FindByLoginDataHandle(IUserId);

            if (loginData != null)
            {
                m_url = loginData.DeviceIP;
            }
            else
            {
                return -1;
            }

            uint realHandle = VSNET_ClientStart(loginData.LoginHandle, m_url, 5454, ref m_pChaninfo);

            if ((int)realHandle != -1 && (int)realHandle != 0)
            {
                RealHandleData realHandleData = new RealHandleData();
                realHandleData.WndHandle = IntPtr.Zero;
                realHandleData.ChannelNo = lChannel;
                realHandleData.LoginHandle = loginData.LoginDataHandle;
                realHandleData.RealHandle = realHandle;
                realHandleData.RealPlayHandle = realHandle.GetHashCode();

                if (!realHandleDataList.Contents(realHandleData))
                {
                    realHandleDataList.Add(realHandleData);
                }

                return realHandleData.RealPlayHandle;
            }
            else
            {
                return -1;
            }
        }
        /// <summary>
        /// 功能:启动图像实时预览
        /// </summary>
        /// <param name="IUserId">用户登录ID,DeviceLogin 的返回值.</param>
        /// <param name="lChannel">硬盘录像机通道号</param>
        /// <param name="hPlayWnd">播放窗口的句柄</param>
        /// <returns>返回值:-1 表示失败,其他值作为其它函数的参数</returns>
        public int RealPlay(int IUserId, int lChannel, IntPtr hPlayWnd)
        {
            CHANNEL_CLIENTINFO m_pChaninfo = new CHANNEL_CLIENTINFO();
            m_pChaninfo.m_channelID = (byte) (lChannel-1);
            m_pChaninfo.m_buffnum = 50;
            m_pChaninfo.m_hVideoWnd = hPlayWnd;
            m_pChaninfo.m_streamType = 0;
            m_pChaninfo.m_tranType = 1;
            m_pChaninfo.m_streamType = 0;
            m_pChaninfo.m_startplay = true;
            m_pChaninfo.m_sFilename = "";

            string m_url="";

            ILoginData loginData = loginDataList.FindByLoginDataHandle(IUserId);

             if (loginData != null)
            {
                m_url = loginData.DeviceIP;
            }
             else
             {
                 return -1;
             }

            uint realHandle = VSNET_ClientStart(loginData.LoginHandle, m_url, 5454, ref m_pChaninfo);

            if ((int)realHandle != -1 && (int)realHandle != 0)
            {
                RealHandleData realHandleData = new RealHandleData();
                realHandleData.WndHandle = hPlayWnd;
                realHandleData.ChannelNo = lChannel;
                realHandleData.LoginHandle = loginData.LoginDataHandle;
                realHandleData.RealHandle = realHandle;

                //realHandleData.RealPlayHandle = (int) lastRealPlayHandleHT[(int) hPlayWnd];

                if (!lastRealPlayHandleHT.Contains(hPlayWnd))
                {
                    realHandleData.RealPlayHandle = realHandle.GetHashCode();
                }
                else
                {
                    if ((int)lastRealPlayHandleHT[hPlayWnd] != -1)
                    {
                        realHandleData.RealPlayHandle = (int)lastRealPlayHandleHT[hPlayWnd];
                        lastRealPlayHandleHT[hPlayWnd] = -1;
                    }
                    else
                    {
                        realHandleData.RealPlayHandle = realHandle.GetHashCode();
                    }
                }

                //if (lastRealPlayHandle != -1)
                //{
                //    realHandleData.RealPlayHandle = lastRealPlayHandle;
                //    lastRealPlayHandle = -1;
                //}
                //else
                //{
                //    realHandleData.RealPlayHandle = realHandle.GetHashCode();
                //}

                if (!realHandleDataList.Contents(realHandleData))
                {
                    realHandleDataList.Add(realHandleData);
                }

                return realHandleData.RealPlayHandle;
            }
            else
            {
                return -1;
            }
        }