| | |
Appending the content of a text file to another text file
Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
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 bitmap box c# check checkbox client combobox control conversion csharp customactiondata database datagrid datagridview dataset datastructure date/time datetime datetimepicker degrees directrobot dll draganddrop drawing encryption enum excel file filename files form format formbox forms function gdi+ gis gtk hash image input install java label list mandelbrot math mouseclick mp3 mysql native operator outlook2003 packaging path photoshop picturebox pixelinversion pixelminversion post print process programming radians regex remoting richtextbox safari server sleep snooze socket sql statistics string table tables tcp text textbox thread time timer update usercontrol usercontrols validation visualstudio webbrowser webcam wfa wia winforms wpf xml






