예제 #1
0
 private void lstData_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     try
     {
         ListViewItem item = lstData.SelectedItems[0];
         if (item.Tag == null)
         {
             m_Ftp.ComeOutDirectory();
             LoadData();
         }
         else
         {
             FTPDataInfo info = item.Tag as FTPDataInfo;
             if (info.Type == FTPDataType.Directory)
             {
                 m_Ftp.ComeInDirectory(info.Name);
                 LoadData();
             }
         }
     }
     catch (Exception ex)
     {
         Log.OutputBox(ex);
     }
 }
예제 #2
0
 private void btnDownload_Click(object sender, EventArgs e)
 {
     try
     {
         FolderBrowserDialog folder = new FolderBrowserDialog
         {
             Description         = "下载文档资料。",
             RootFolder          = Environment.SpecialFolder.Desktop,
             ShowNewFolderButton = true,
         };
         if (folder.ShowDialog() == DialogResult.OK)
         {
             m_loadIndex = 1;
             foreach (ListViewItem item in lstData.CheckedItems)
             {
                 FTPDataInfo info = item.Tag as FTPDataInfo;
                 if (info.Type == FTPDataType.Directory)
                 {
                     Directory.CreateDirectory(folder.SelectedPath + "\\" + info.Name);
                     m_Ftp.Download(info.Name, folder.SelectedPath + "\\" + info.Name, FTPDataType.Directory);
                 }
                 else
                 {
                     m_Ftp.Download(info.Name, folder.SelectedPath + "\\" + item.Text, FTPDataType.Other);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Log.OutputBox(ex);
     }
 }