The Blog demonstrate a method to Copy Multiple Text Documents to a Single Text Document, using StreamReader & StreamWriter Classes.
About Classes used -
#1: StreamReader class provides an access to read the data from Stream such as Text File.
#2: StreamWriter class provides an access to write the data from Stream such as Text File.
Namespace Required - System.IO,
Controls Used -
1. TextBox Control (txtOutput)
2. ListBox Control (lbInput)
2. Button Control (btnCopy, btnInputFile)
Here I implemented the Code for converting multiple Text Documents into single Text Document.
1. Variable Declarations
2. Select the Input Text Files (code for “Select Input Files” Button).
3. Copy Data from Multiple Text Files to Single Text File (code for “Copy All” Button).
4. Now execute the Application and see the result (Figure 1).
In this piece of writing, using C# environment, we have seen basic stream input/output operation for copying multiple text files to single text file using StreamWriter & StreamReader classes.