Skip to main content

How To

How to get the list of files in a given directory using C#?

Posted in

If I need to get a list of files of a particular type or extension in a given directory, how can I get that list using C# code. Here is an example where the code looks for files in the current directory with .txt extension and writes the list to the console.

How to read the contents of a text file using StreamReader class in C#?

Posted in

Using StreamReader class in C# can be fun and very handy to do some important tasks. Here is an example which will help you to understand how to use the StreamReader to read through a text file and also write it to the console line by line.

How to read Text from multiple files and write it to a single file using StreamReader and StreamWriter in C#?

Posted in

Here is an example of using StreamReader and StreamWriter class in C# to Read a number of text files from the source location and writing the contents of all the text files into a single Final Large file.

Syndicate content