Guest User

Untitled

a guest
Feb 18th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. private void backgroundWorker3_DoWork(object sender, DoWorkEventArgs e)
  2. {
  3.  
  4. List<string> result = new List<string>();
  5.  
  6. var found = obj.getFiles();//List<strings>
  7. if (found.Count != 0)
  8. {
  9.  
  10. for (int i = 0; i < found.Count; i++)
  11. {
  12. int progress = (int)(((float)(i + 1) / found.Count) * 100);
  13. if (found[i].Contains("SFTP"))
  14. {
  15. result.Add(found[i]);
  16.  
  17. (sender as BackgroundWorker).ReportProgress(progress, found[i]);
  18. }
  19. System.Threading.Thread.Sleep(500);
  20. }
  21.  
  22.  
  23.  
  24. e.Result = result;
  25.  
  26. }
  27. }
  28.  
  29. private void backgroundWorker3_ProgressChanged(object sender, ProgressChangedEventArgs e)
  30. {
  31. if (e.UserState != null)
  32.  
  33. listBox3.Items.Add(e.UserState);
  34.  
  35. }
Add Comment
Please, Sign In to add comment