Add files to folder

Hey guys,

Sorry about the obscure title, but I have been trying to figure this out for so long, that I think my brain is melting… Anyway…

Basically, I want to take all the files in folder A and move them to C, which is inside B. Let me try to explain this a little better. I want to take all the files that are in the folder “tempPath”, and move them to “folderA”.
This would be easy enough, but folderA already exists and it has stuff in it that I don’t want to delete.
And, for the life of me, I can’t figure out how to do this!

tempPath is located at:

static string tempPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + Path.DirectorySeparatorChar + "tempPath";

folderA is located at:

static public string folderA = "/Users/" + Environment.UserName + "/Documents/HardFiles/folderA";

I really appreciate any help you can give me! ∆ Gibson

Easy enough-

using System.IO;

// inside the function:
foreach(string file in Directory.GetFiles(tempPath))
    string fName = file.Substring(tempPath.Length + 1);
    File.Move(file, Path.Combine(folderA, fName));

That should do it! Make sure that you don’t have any files of the same name in the destination directory.