Converting an Enum to Integer in C#

If you need to convert an enum to its numeric equivalent , you can simply cast the values to integer . Below is a sample code snippet that demonstrates how to do it. Converting an Enum to Integer in ...

Example of Enumeration in C#

Below is a sample code snippet that demonstrates how to declare , define and access the Enumeration in C#. Example of Enumeration in C# using System; using System.Collections.Generic; using System.Gl...

How to Generate Unique ID in C# ?

Do you want to generate a unique id in C# ? . You can use Guid to generate unique data or ID. Below is a sample code snippet that demonstrates how to generate unique ID in C# . How to Generate Unique...

How to Get the Random Number in C# ?

Below is a sample code snippet that shows how to get a random number in C#. How to Get the Random Number in C# ? using System; using System.Collections.Generic; using System.Linq; using System.Text; ...

How to Count the Number of 1 Bits in C# ?

Do you want to count theĀ  number of 1′s in a number in C# ? . Below is a sample source code that demonstrates how to count the number of 1 bits. How to Count the Number of 1 Bits in C# ? using ...