| | |
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 animation array barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom customactiondata database datagrid datagridview dataset datastructure date/time datetime datetimepicker degrees development dll draganddrop drawing encryption enum event excel file filename files form format forms function gdi+ gis gtk hash image index input install java label list listbox mandelbrot math mouseclick mysql operator outlook2003 path photoshop picturebox pixelinversion pixelminversion post programming radians regex remoting richtextbox server sleep snooze socket sql statistics stream string table tables tcp text textbox thread time timer update usercontrol usercontrols validation visualstudio webbrowser webcam wia windows winforms wpf xml






