private void ftp1_Progress(object sender, CleverComponents.InetSuite.ProgressEventArgs e) { if (e.TotalBytes > 0) { progressBar1.Maximum = (int)e.TotalBytes; progressBar1.Value = (int)e.BytesProceed; } }
private void smtp1_Progress(object sender, CleverComponents.InetSuite.ProgressEventArgs e) { if (e.TotalBytes < e.BytesProceed) { return; } progressBar1.Maximum = (int)e.TotalBytes; progressBar1.Value = (int)e.BytesProceed; decimal d = System.Math.Round((decimal)(progressBar1.Value * 100 / progressBar1.Maximum)); lblProgress.Text = string.Format("{0} %", d.ToString()); Application.DoEvents(); }