示例#1
0
        private void frmDownload_FormClosing(object sender, FormClosingEventArgs e)
        {
            //Clear the Progress of the TaskBar Progressbar
            TaskBarManager.ClearProgressValue();

            Happened            = false;
            this.taskDialogMain = null;
        }
示例#2
0
        private void btnUpload_Click(object sender, EventArgs e)
        {
            //Clear the Progress of TaskBar Progressbar
            TaskBarManager.ClearProgressValue();

            objOpenDialog             = new CommonOpenFileDialog("Select File to Upload");
            objOpenDialog.Multiselect = false;
            CommonFileDialogFilter Filter = new CommonFileDialogFilter("All Files", "*.*");

            objOpenDialog.Filters.Add(Filter);
            objOpenDialog.RestoreDirectory = true;
            if (objOpenDialog.ShowDialog() == CommonFileDialogResult.OK)
            {
                //Declare and Setup out UploadForm Variable.  The frmUpload Constructor will do everything else, including showing the form.
                frmUpload UploadForm = new frmUpload(objOpenDialog.FileName, FtpClient.CurrentDirectory, FtpClient);
            }
            //Call RefreshDirectory; Refresh the Files and Folders for Current Directory.
            RefreshDirectory();
        }
示例#3
0
        private void downloadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //Clear the Progress
            TaskBarManager.ClearProgressValue();

            try
            {
                if (lstRemoteSiteFiles.SelectedItems[0] != null)
                {
                    if (lstRemoteSiteFiles.SelectedItems[0].SubItems[1].Text == "File")
                    {
                        //Download File
                        DownloadFile(lstRemoteSiteFiles.SelectedItems[0].Text, FtpClient.CurrentDirectory);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#4
0
        /// <summary>
        /// frmDownload constructor
        /// </summary>
        /// <param name="Filename">Name of the File to Download</param>
        /// <param name="Current_Directory">Current Directory of the FTPClient; where file will be downloaded from.</param>
        /// <param name="SavePath">Path where the File will be saved.</param>
        /// <param name="Ftpclient">FTPClient from frmMain that will be refrenced here to FtpClient variable.</param>
        public frmDownload(string Filename, string Current_Directory, string SavePath, FTPclient Ftpclient)
        {
            //Init Form
            InitializeComponent();

            //Setup Variables
            FileName             = Filename;
            SaveFilePath         = SavePath;
            CurrentDirectory     = Current_Directory;
            lblDownloadFrom.Text = Ftpclient.Hostname + Current_Directory + FileName;   //ex: ftp://ftp.somesite.com/current_dir/File.exe
            lblSavePath.Text     = SaveFilePath;
            FtpClient            = Ftpclient;
            TaskBarManager.ClearProgressValue();

            //Aero Composition Event
            AeroGlassCompositionChanged += new AeroGlassCompositionChangedEvent(Form1_AeroGlassCompositionChanged);

            if (AeroGlassCompositionEnabled)
            {
                //We don't want pnlNonTransparent and the controls in it to be part of AERO
                //but we do want Aero...looks cool ;)
                ExcludeControlFromAeroGlass(pnlNonTransparent);
            }
            else
            {
                this.BackColor = Color.Teal;
            }

            //Show Form
            this.Show();

            //Setup our Download Client and Start Downloading
            FtpClient.CurrentDirectory           = Current_Directory;
            FtpClient.OnDownloadProgressChanged += new FTPclient.DownloadProgressChangedHandler(FtpClient_OnDownloadProgressChanged);
            FtpClient.OnDownloadCompleted       += new FTPclient.DownloadCompletedHandler(FtpClient_OnDownloadCompleted);
            FtpClient.Download(FileName, SavePath, true);
        }
示例#5
0
 private void frmUpload_FormClosing(object sender, FormClosingEventArgs e)
 {
     //Clear the Progress of the TaskBar Progressbar
     TaskBarManager.ClearProgressValue();
 }