I've started to wonder how do i manipulate files in a pc and the first and, i think, the most simple start should be moving all from one folder to another, though doing the research all the microsoft pages used examples with a specified file to move. So i've tried doing the implementation of the code (simple removing the specified file from directory), but it doesn't seem to work, can you guys give me an example of how to to use File.Move() or Directory.Move() functions to move ALL files in a folder? BTW i am kind of a beginner, so don't throw a massive code full of unknown stuff :P
ive tried a simple one: EDIT:
using System;
using System.IO;
class Test
{
public static void Main()
{
string path = @"C:\TESTmove\Location";
string path2 = @"C:\TESTmove\Destination";
if (Directory.Exists(path))
{
Directory.Move(path, path2);
}
Console.ReadKey ();
}
}
OK, so now i dont have my destination folder created. It executes, moves files to destination folder and demolishes the location folder. How to fix that deleting?