| | |
How to merge two text files
Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Aug 2008
Posts: 1,735
Reputation:
Solved Threads: 186
Firstly, think of how you would want to do it, write it down.
Work out some code that looks like it should do what you wanted.
try it, what does it do?
if it doesnt work, post it, explain what you're getting you didnt expect, and ask for assistance.
Dont post just asking for us to do it for you
Work out some code that looks like it should do what you wanted.
try it, what does it do?
if it doesnt work, post it, explain what you're getting you didnt expect, and ask for assistance.
Dont post just asking for us to do it for you
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
•
•
Join Date: Feb 2008
Posts: 46
Reputation:
Solved Threads: 4
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
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
•
•
•
•
Originally Posted by BlackSun
TextBox1.Text=sr.ReadLine();
What's the relevancy with this question ?
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Make love, no war. Cave ab homine unius libri.
Danny
That's very inventive BlackSun.
But if I drink wine I use a wineglass.
When I drink a coffee I use a coffeecup.
Do you drink wine from a coffeecup?
Don't use a textbox for this, but use a string.
But if I drink wine I use a wineglass.
When I drink a coffee I use a coffeecup.
Do you drink wine from a coffeecup?
Don't use a textbox for this, but use a string.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Make love, no war. Cave ab homine unius libri.
Danny
![]() |
Similar Threads
- How can show/view Infopath dynamic files(xml) without infopath in a computer (XML, XSLT and XPATH)
- Help with automatic update problem and more (Viruses, Spyware and other Nasties)
- Merge Files , in c++ (C++)
- Trying to get a program to extract data from a text file (C++)
- how to read many text file? (C++)
- Merge Sort (C++)
- How to handle multiple files, to Excel (VB.NET)
- Trying to compare the contents of two text files and save the difference (Python)
- How to open multiple textfile (Visual Basic 4 / 5 / 6)
Other Threads in the C# Forum
- Previous Thread: want to login to windows through c#
- Next Thread: Problems with transaction in SQL Server Mobile
| Thread Tools | Search this Thread |
.net access algorithm array asp.net bitmap box broadcast c# check checkbox client combobox control conversion csharp database datagrid datagridview dataset datetime dbconnection decryption degrees design developer draganddrop drawing encryption enum eventhandlers excel file firefox focus form format forms function gdi+ grantorrevokepermissionthroughc#.net hospitalmanagementsystem image input install interface java libraries list loop marshalbyrefobject math mouseclick movingimage mysql netcfsvcutil.exe numeric operator path photoshop php picturebox pixelinversion platform polynomial post programming properties radians read regex remote remoting richtextbox server sleep socket sql statistics string stringformatting study system.servicemodel table tcpclientchannel text textbox thread time timer update usb usercontrol validation visualstudio webbrowser winforms wpf wpfc# xml






