Beispiel #1
0
        private void QueryFile()
        {
            if (m_iLogonID < 0)
            {
                return;
            }
            if (dtStartTimeFile.Value > dtEndTimeFile.Value)
            {
                MessageBox.Show("Start time > End time");
            }
            //NVS_FILE_QUERY
            NVS_FILE_QUERY Query = new NVS_FILE_QUERY();

            int iType = cbVideoType.SelectedIndex;

            if (iType == 0)
            {
                Query.m_iType = 0xFF;
            }
            else if (iType <= 3)
            {
                Query.m_iType = iType;
            }
            else
            {
                Query.m_iType = 1431;
            }


            Query.m_iChannel = cbPassNOFile.SelectedIndex - 1;
            //if (Query.m_iChannel == -1)
            //{
            Query.m_iChannel = 0xFF;
            // }

            Query.m_struStartTime.m_iYear   = Convert.ToUInt16(dtStartTimeFile.Value.Year);
            Query.m_struStartTime.m_iMonth  = Convert.ToUInt16(dtStartTimeFile.Value.Month);
            Query.m_struStartTime.m_iDay    = Convert.ToUInt16(dtStartTimeFile.Value.Day);
            Query.m_struStartTime.m_iHour   = Convert.ToUInt16(dtStartTimeFile.Value.Hour);
            Query.m_struStartTime.m_iMinute = Convert.ToUInt16(dtStartTimeFile.Value.Minute);
            Query.m_struStartTime.m_iSecond = Convert.ToUInt16(dtStartTimeFile.Value.Second);


            Query.m_struStoptime.m_iYear   = Convert.ToUInt16(dtEndTimeFile.Value.Year);
            Query.m_struStoptime.m_iMonth  = Convert.ToUInt16(dtEndTimeFile.Value.Month);
            Query.m_struStoptime.m_iDay    = Convert.ToUInt16(dtEndTimeFile.Value.Day);
            Query.m_struStoptime.m_iHour   = Convert.ToUInt16(dtEndTimeFile.Value.Hour);
            Query.m_struStoptime.m_iMinute = Convert.ToUInt16(dtEndTimeFile.Value.Minute);
            Query.m_struStoptime.m_iSecond = Convert.ToUInt16(dtEndTimeFile.Value.Second);


            Query.m_iPageSize = NVSSDK.MAX_PAGESIZE;
            Query.m_iPageNo   = m_iCurrentPage;
            Query.m_iFiletype = cbFileType.SelectedIndex;


            int ret;

            //Int32 i = 0;
            //Int32 j = 0;

            try
            {
                ret = NVSSDK.NetClient_NetFileQuery(m_iLogonID, ref Query);
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("NetClient_NetFileQuery failed" + ex.Message);
                return;
            }

            if (ret < 0)
            {
                MessageBox.Show("NetClient_NetFileQuery failed");
                return;
            }
        }