please help me to append one file's content to an existing one

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • meettapan
    New Member
    • Jun 2007
    • 9

    please help me to append one file's content to an existing one

    Any one please help me to Append the content of file2 to the existing
    file1 in c#

    with regards
    Tapan
  • blackjack2150
    New Member
    • Feb 2007
    • 79

    #2
    If file1.txt exists already:

    StreamWriter sw = new StreamWriter("f ile1.txt", true);
    sw.write("some text here");

    or, even easier, but significantly slower:

    File.AppendAllT ext("file1.txt" , "some text here");

    Comment

    Working...