示例#1
0
        /// <summary>
        /// Get fileinfo and update ui
        /// </summary>
        private void Update_UI_Query_Result()
        {
            lbFileNumber.Text = "File Number:" + m_iTotalCount.ToString();

            cbTotolPage.Items.Clear();
            for (int i = 0; i < m_iTotalPage; i++)
            {
                cbTotolPage.Items.Add(i + 1);
            }
            //cbTotolPage.SelectedIndex = m_iCurrentPage;

            lvFileData.Items.Clear();

            for (int i = 0; i < m_iCurrentCount; i++)
            {
                NVS_FILE_DATA filedata = new NVS_FILE_DATA();
                int           iret     = NVSSDK.NetClient_NetFileGetQueryfile(m_iLogonID, i, ref filedata);
                if (iret < 0)
                {
                    MessageBox.Show("NetClient_NetFileGetQueryfile failed");
                    return;
                    //GetLastError()
                }
                else
                {
                    ListViewItem one = new ListViewItem();
                    one.Text = (m_iCurrentPage * NVSSDK.MAX_PAGESIZE + i).ToString();
                    string str = new string(filedata.m_cFileName, 0, filedata.m_cFileName.Length);
                    str = str.Trim("\0".ToCharArray());
                    one.SubItems.Add(str);
                    one.SubItems.Add(filedata.m_iType.ToString());
                    one.SubItems.Add(filedata.m_iFileSize.ToString());
                    string stime = filedata.m_struStartTime.m_iYear.ToString() + "-" +
                                   filedata.m_struStartTime.m_iMonth.ToString("D2") + "-" +
                                   filedata.m_struStartTime.m_iDay.ToString("D2") + " " +
                                   filedata.m_struStartTime.m_iHour.ToString("D2") + ":" +
                                   filedata.m_struStartTime.m_iSecond.ToString("D2") + ":" +
                                   filedata.m_struStartTime.m_iMinute.ToString("D2");
                    one.SubItems.Add(stime);
                    stime = filedata.m_struStoptime.m_iYear.ToString() + "-" +
                            filedata.m_struStoptime.m_iMonth.ToString("D2") + "-" +
                            filedata.m_struStoptime.m_iDay.ToString("D2") + " " +
                            filedata.m_struStoptime.m_iHour.ToString("D2") + ":" +
                            filedata.m_struStoptime.m_iSecond.ToString("D2") + ":" +
                            filedata.m_struStoptime.m_iMinute.ToString("D2");
                    one.SubItems.Add(stime);
                    one.SubItems.Add("");  // 预留增加下载进度
                    lvFileData.Items.Add(one);
                }
            }
        }