Esempio n. 1
0
 public DownFile(UserInfo user,Down down)
 {
     InitializeComponent();
     user.DownDataOn = DataIn;
     this.user = user;
     this.down = down;
     this.FormClosed += new FormClosedEventHandler(DownFile_FormClosed);
     IsCheckTable = new List<CheckB>();
     this.Text = "正在下载:" + down.FullName;
 }
Esempio n. 2
0
        private void listView2_DoubleClick(object sender, EventArgs e)
        {
            if (listView2.SelectedItems.Count > 0 && CurrentClient!=null)
            {
                ListViewItem item = listView2.SelectedItems[listView2.SelectedItems.Count - 1];
                string DirName = "";

                FileSystem dirinfo = item.Tag as FileSystem;
                if (dirinfo.FileType == FileType.Dir)
                {
                    DirName = dirinfo.FullName;
                }
                else
                {
                    if (MessageBox.Show("是否下载文件:" + dirinfo.Name + "?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                         FileSystem downFile = (this.listView2.SelectedItems[this.listView2.SelectedItems.Count - 1].Tag as FileSystem);

                         if (downFile != null)
                         {
                             Down down = new Down()
                              {
                                  FullName = downFile.FullName

                              };

                             CurrentClient.SendData(BufferFormatV2.FormatFCA(down));

                         }
                    }
                    return;
                }

                GetFile tmp = new GetFile()
                {
                    DirName = DirName,
                    FileSystemList = new List<FileSystem>(),
                    IsSuccess = false,
                    Msg = ""
                };

                CurrentClient.SendData(BufferFormatV2.FormatFCA(tmp));
            }
        }