コード例 #1
0
        private void getReomteFileList()
        {
            fileItems = new List <FileItem>();
            String   jsonString = HTTPRequestMannager.RequestDataRemote(severFileUpdatePath + ConstValue.GET_REMOTE_FILE_LIST);
            FileItem file       = new FileItem {
            };
            JsonArray jsonArray = new JsonArray(jsonString);

            for (int i = 0; i < jsonArray.length(); i++)
            {
                FileItem fileItem = new FileItem();
                fileItem.Name    = jsonArray.get(i).getString("mFileName");
                fileItem.OutTime = jsonArray.get(i).getString("mFileUpdateTime");
                fileItem.Count   = jsonArray.get(i).getString("mCount");
                fileItem.Desc    = jsonArray.get(i).getString("mDesc");
                fileItems.Add(fileItem);
            }

            foreach (FileItem f in fileItems)
            {
                mListView.Items.Add(
                    new FileItem {
                    Name = f.Name, OutTime = f.OutTime, Count = f.Count, Desc = f.Desc
                }
                    );
            }
        }
コード例 #2
0
        //删除文件
        private void deleteFile(FileItem fileItem)
        {
            String rcode = HTTPRequestMannager.RequestDataRemote(severFileUpdatePath + ConstValue.DELETE_FILE + "&fc=" + fileItem.Name);

            if (rcode.Equals("OK"))
            {
                mListView.Items.Remove(fileItem);
            }
            else
            {
                MessageBox.Show("删除失败");
            }
        }