Assuming your files are text files, (or you wouldn't be trying WriteAllText) there are a huge number of ways you could do it - but most of the problem is centered on the "Merge" part.
If you have two files on disk, and you want to just create a third file with one following the other, then it's pretty easy:
open the output file, as a stream, and read the input files in chunks, writing each chunk to the output.
private void butMerge_Click(object sender, EventArgs e)
{
using (StreamWriter sw = new StreamWriter(@"D:\Temp\Output.txt"))
{
AppendFile(sw, @"D:\Temp\MyHugeText1.txt");
AppendFile(sw, @"D:\Temp\MyHugeText2.txt");
}
}
private void AppendFile(StreamWriter sw, string path)
{
int blockSize = 1024 * 1024 * 8;
char[] block = new char[blockSize];
using (StreamReader sr = new StreamReader(path))
{
while (!sr.EndOfStream)
{
int chars = sr.Read(block, 0, blockSize);
sw.Write(block, 0, chars);
}
}
}