Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void findFiles(String folder)
- {
- if (!Directory.Exists(Desktop + "\\" + tbFolder.Text))
- {
- Directory.CreateDirectory(Desktop + "\\" + tbFolder.Text);
- }
- var amount = Directory.GetFiles(folder).Count();
- pgFiles.Maximum = amount;
- DirectoryInfo d = new DirectoryInfo(Desktop);
- foreach (var f in d.GetFiles("*.*"))
- {
- pgFiles.Value ++;
- lbFiles.Items.Add("Moving: \n" + f);
- lbFiles.SelectedIndex = lbFiles.Items.Count - 1;
- lbFiles.SelectedIndex = -1;
- Application.DoEvents();
- Thread.Sleep(1);
- foreach (var file in d.GetFiles("*.*"))
- {
- Directory.Move(file.FullName, Desktop + "\\" + tbFolder.Text + "\\" + file.Name);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment