25 Ağustos 2016 Perşembe

Move Files into Folders C#

string targetDirectory = tDirectory_TextBox.Text;
foreach (string d in Directory.GetFiles(targetDirectory)) { string destination = targetDirectory + "\\" + Path.GetFileNameWithoutExtension(d); Directory.CreateDirectory(destination); destination += "\\" + Path.GetFileName(d); File.Move(d, destination); }