View Single Post
Join Date: Feb 2008
Posts: 46
Reputation: BlackSun is an unknown quantity at this point 
Solved Threads: 4
BlackSun BlackSun is offline Offline
Light Poster

Re: How to merge two text files

 
0
  #4
Jan 10th, 2009
hi
try using namespace System.IO;you will find two classes responsible for reading and writing from file with more options are :
- StreamReader ;
- StreamWriter ;
u can read ur file using StreamReader the write it using StreamWriter
but after using ur StreamReader and Writer close them EX :
StreamReader sr = new StreamReader(Strin Path);
TextBox1.Text=sr.ReadLine();
sr.close(); ------------> close reader;

and the same with Writer ;

there is another class File contains static members
File.ReadAllText();
File.WriteAllText();
File.open(string path , filemode.append);

all these depends on ur application if u wana preview ur text file and append with another file or u wanna do ur method during procesisng ur code ;

there is more but that easy ways u can append ur txt files

bye
Reply With Quote