What would be the fastest way to concatenate three files in C#?

后端 未结 7 1786
滥情空心
滥情空心 2020-11-29 07:40

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

7条回答
  •  误落风尘
    2020-11-29 07:58

    Another way....how about letting the OS do it for you?:

    ProcessStartInfo psi = new ProcessStartInfo("cmd.exe", 
            String.Format(@" /c copy {0} + {1} + {2} {3}", 
                file1, file2, file3, dest));
    psi.UseShellExecute = false;
    Process process = Process.Start(psi);
    process.WaitForExit();
    

提交回复
热议问题