Guest User

Untitled

a guest
Jun 8th, 2013
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. public void findFiles(String folder)
  2. {
  3. if (!Directory.Exists(Desktop + "\\" + tbFolder.Text))
  4. {
  5. Directory.CreateDirectory(Desktop + "\\" + tbFolder.Text);
  6.  
  7. }
  8. var amount = Directory.GetFiles(folder).Count();
  9. pgFiles.Maximum = amount;
  10. DirectoryInfo d = new DirectoryInfo(Desktop);
  11.  
  12. foreach (var f in d.GetFiles("*.*"))
  13. {
  14. pgFiles.Value ++;
  15. lbFiles.Items.Add("Moving: \n" + f);
  16. lbFiles.SelectedIndex = lbFiles.Items.Count - 1;
  17. lbFiles.SelectedIndex = -1;
  18. Application.DoEvents();
  19. Thread.Sleep(1);
  20.  
  21. foreach (var file in d.GetFiles("*.*"))
  22. {
  23. Directory.Move(file.FullName, Desktop + "\\" + tbFolder.Text + "\\" + file.Name);
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment