Sure. In that case, Jon's answer would be what you need to do. To quote Jon:
Unless you really care about them being text files (and changing the
encoding, for example) I'd just copy them as binary files:
1) Open a stream to write to
2) Open the first stream to read from
3) Read chunks at a time, writing to the output stream each time
4) When that file has been finished, close the stream and move onto
the next file (back to step 2)
5) When you've finished all the files, close the output stream.
Note that you should always use the return value from Stream.Read to
find out how many bytes have actually been read.
One possible caveat here: This technique will not work as is unless all of
the files are using the same encoding. Chances are, they are, but you should
make sure if they are not. If they are not the same encoding, you can
convert them to a common encoding on the fly if necessary.
If you're not sure all of the files have the same encoding, the following
article tells you how to detect the encoding of a file:
http://www.dotnet247.com/247referenc...utorial_id=469
Once you've detected the encoding, you will want to read the file into an
array of bytes, and convert it using the Encoding.Convert method. You can
then write the bytes to a File Stream. Keeping the File Stream open, you can
open, read, convert, and write each successive file to the new text file in
the same way until you're done.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.
":)" <ta******@hotmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Thanks for your answer. My requirement is combine servral .txt file
into one .txt files.