Tutorials
VB.NET 2005
StreamReader is useful for reading lines of information from standard text file and StreamWriter is useful for writing to standard text files. We shall see a an example that illustrates these functions.

We are using the methods of FileStream, StreamReader and StreaWriter to create a file, write data to it and read from the file. The codes for the program are given below:
Click here to view sample code
The out put window and the text file the program has generated are shown below:
Opening Screen With text:

The program window after writing and reading Twice:
. 
The text file created is shown below:


Now add the following code to the form.
Click here to view sample code
This program will create a binary file and also read the binary file. Now press F5 to execute the program. A form will appear. Click the button ReadWrite. The output of the program is shown below:

The bin file that was created by this action is opened with text editor and shown below:

First Page: Working with File System in .NET
|
I'm wanting to append many text files together in a given directory(say kel.txt,kel1.text,kel3.txt,kel4.txt exist in a directory i.e C:Temp) How can i append them together and save resulting data in a .txt file called appendText.txt. can anyone help.. cheers |
| This is very good article. This article helped me very much in Stringreader and stringwriter . Very nice. |