I need to concatenate 3 files using C#. A header file, content, and a footer file, but I want to do this as cool as it can be done.
Cool = really small code or reall
If your files are text and not large, there's something to be said for dead-simple, obvious code. I'd use the following.
File.ReadAllText("file1") + File.ReadAllText("file2") + File.ReadAllText("file3");
If your files are large text files and you're on Framework 4.0, you can use File.ReadLines
to avoid buffering the entire file.
File.WriteAllLines("out", new[] { "file1", "file2", "file3" }.SelectMany(File.ReadLines));
If your files are binary, See Mehrdad's answer