| |
Sign In
private void btnUpload_Click(object sender, EventArgs e){ // create a new FtpSettings class to store all the paramaters for the FtpProgress thread FtpSettings f = new FtpSettings(); f.Host = this.txtHost.Text; f.Username = this.txtUsername.Text; f.Password = this.txtPassword.Text; f.TargetFolder = this.txtDir.Text; f.SourceFile = this.txtUploadFile.Text; f.Passive = this.chkPassive.Checked; f.Port = Int32.Parse(this.txtPort.Text); this.ftpProgress1.RunWorkerAsync(f);}private void ftpProgress1_ProgressChanged(object sender, ProgressChangedEventArgs e){ this.toolStripStatusLabel1.Text = e.UserState.ToString(); // the message will be something like: 45 Kb / 102.12 Mb this.toolStripProgressBar1.Value = Math.Min(this.toolStripProgressBar1.Maximum, e.ProgressPercentage); }
Remember Me