Exemplo n.º 1
0
 /// <summary>
 /// Download File: When File is dragged from ListView to the tvFileSystem.  No SaveAsDialog/SavePath is the selected node in
 /// tvFileSystem
 /// </summary>
 /// <param name="FileName">Name of File to Download</param>
 /// <param name="CurrentDirectory">CurrentDirectory (Directory from which to download on server)</param>
 /// <param name="SavePath">Path where file will be downloaded.</param>
 private void DownloadFile(string FileName, string CurrentDirectory, string SavePath)
 {
     //Setup and Open Download Form
     if (SavePath.EndsWith("\\"))
     {
         frmDownload DownloadForm = new frmDownload(FileName, CurrentDirectory, SavePath + FileName, FtpClient);
     }
     else
     {
         //Setup and Open Download Form
         frmDownload DownloadForm = new frmDownload(FileName, CurrentDirectory, SavePath + "\\" + FileName, FtpClient);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Download File: When the Download ToolStripButton is clicked. Displays a SaveFileDialog.
        /// </summary>
        /// <param name="FileName">Name of the File to Download</param>
        /// <param name="CurrentDirectory">CurrentDirectory (Directory from which to download on server)</param>
        private void DownloadFile(string FileName, string CurrentDirectory)
        {
            //Setup and Show
            CommonSaveFileDialog SaveDialog = new CommonSaveFileDialog("Save File To...");

            SaveDialog.AddToMostRecentlyUsedList = true;
            SaveDialog.DefaultFileName           = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            SaveDialog.DefaultFileName           = FileName;
            if (SaveDialog.ShowDialog() == CommonFileDialogResult.OK)
            {
                //Setup and Open Download Form
                frmDownload DownloadForm = new frmDownload(FileName, CurrentDirectory, SaveDialog.FileName, FtpClient);
            }
            else
            {
                TaskDialog.Show("Download has been cancelled.");        //Notify user that Download has been cancelled.
            }
        }