| | |
Appending the content of a text file to another text file
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
Hello there, I've been busy nowadays with file manipulation and I've so far I've encountered a small problem in appending the contents of a file to another file. This is what I did:
It seems that I can't append the content of files2 to my Temp.txt file after placing the contents of files. Please help. Thanks.
C# Syntax (Toggle Plain Text)
string filename = @"C:\Temp.txt"; string body = null; StreamReader sr = File.OpenText(files); body = sr.ReadToEnd(); StreamWriter sw = File.Create(filename); sw.WriteLine(body); sr = File.OpenText(files2); body = sr.ReadToEnd(); File.AppendAllText(filename, body); sw.Close();
It seems that I can't append the content of files2 to my Temp.txt file after placing the contents of files. Please help. Thanks.
An Avalanche In D Minor
![]() |
Similar Threads
- Introducing EchoQuiet (Community Introductions)
Other Threads in the C# Forum
- Previous Thread: File details in to List View using a file dialog box
- Next Thread: How to control Ms Powerpoint 2007 Slide show using C# 3.5?
| Thread Tools | Search this Thread |
.net access algorithm array backup barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom database databasesearch datagrid datagridview datagridviewcheckbox dataset datetime degrees development draganddrop drawing dynamiccreation encryption enum equation excel file form format formatting forms function gdi+ hospitalmanagementsystems httpwebrequest image index input install interface java label list listbox mandelbrot math mouseclick mysql namevaluepairs operator path photoshop picturebox pixelinversion post powerpacks programming property radians regex remoting resource restore richtextbox running... server sleep soap socket sql stack statistics stream string table text textbox thread time timer update usercontrol validation visualstudio wait webbrowser windows winforms working wpf write xml






