Reading a Text File in C# through Stream Reader



This C# program shows you how you can load an external Text File from your Hard Disk into a Multi-Line TextBox. The procedure consists of creating the StreamWriter object to begin working which is the feature of this code.  Watch the image above.

Working With Enumerations in C#


.Net Enumeration Basics

Enumerations or simply Enums in short provide convenient ways to create and access named numeric constants. These constants can have custom Indexable values that represent each individual element. Unlike arrays, they can have values which are not incremental in steps of ‘1’. Also, these values can be of types other than integers (which is the default) such as bytes, Boolean etc.

A single Enumeration itself has a group of values associated with it. We create an Enum Object before attempting to use the functions that are offered. This value when used with a dot operator on an Enumeration gives the state of the Enumeration Object. When we initialize new Enums of a previously defined Enum, we don’t use the new operator. The new Enums are almost immediately created and initialized to an initial value within the Enum.

Create an Enum