Public Access Modifier in C# with Example

Public access modifier is one of the 5 access modifiers in C#.  Public access modifier is only used when you want to make any type member to be globally accessible within the containing type as well as outside of the containing type.  An example of Public access modifier in C# is given below.   using

Access Modifiers in C#

In C#, access modifiers play a major role. They basically decide bounderies of your type and type members. Based on the access modifier, you can restrict access or allow access to any type or type member. There are 5 types of access modifiers. Public Private Protected Internal Protected Internal Type members like methods, fields, properties

Base64 Encode & Decode Example in C#/CSharp

A simple Base64 Encode and Decode Example in C#/CSharp.   Base64 Encode Example in C# public static string Base64Encode(string plainText) { var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText); return System.Convert.ToBase64String(plainTextBytes); }     Base64 Decode Example in C# public static string Base64Decode(string base64EncodedData) { var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData); return System.Text.Encoding.UTF8.GetString(base64EncodedBytes); }  

Exception Handling in C# with Example

Exceptions are unexpected errors generated by the CLR.  It is very common that while executing your application you encounter some error and later you fix it by knowing the reason behind it.  There are bunch of predefined exceptions in the DotNet framework like FileNotFound, DivideByZero, FormatException etc.  However, name of these exceptions is pretty much