Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void backgroundWorker3_DoWork(object sender, DoWorkEventArgs e)
- {
- List<string> result = new List<string>();
- var found = obj.getFiles();//List<strings>
- if (found.Count != 0)
- {
- for (int i = 0; i < found.Count; i++)
- {
- int progress = (int)(((float)(i + 1) / found.Count) * 100);
- if (found[i].Contains("SFTP"))
- {
- result.Add(found[i]);
- (sender as BackgroundWorker).ReportProgress(progress, found[i]);
- }
- System.Threading.Thread.Sleep(500);
- }
- e.Result = result;
- }
- }
- private void backgroundWorker3_ProgressChanged(object sender, ProgressChangedEventArgs e)
- {
- if (e.UserState != null)
- listBox3.Items.Add(e.UserState);
- }
Add Comment
Please, Sign In to add comment