Practical solutions

C# Howtos How-To Guides

Solve the problem. Keep building. Collection of C# how-to articles

Find the answer you need

Browse practical solutions, grouped by the task you're working on.

__COUNT__ entries on this page

How to Generate Random Numbers in Unity3DThis article demonstrates the methods to generate integer and floating point random numbers within a specific range using unity3d with C#. How to Overload Assignment Operator in C#In this article, we will explore different methods to overload assignment operator in C#, providing detailed examples for each approach. How to Add Items to ListView in C#A programming guide about using a ListView control in Windows Forms Application in C#. How to Add an Item to a ListBox in C# and WinFormsThis tutorial will teach how to add an item to a ListBox using the C# and WinForms. Lambda Expression in LINQ Statements in C#This is a programming tutorial about Lambda expressions in LINQ select queries. How to Create the Serializable Attribute in C#This tutorial shows how to create and use the serializable attribute in C#. How to Create the Auto Property in C#This tutorial defines how to create and modify the auto property in C#. How to Seed a Random Class in C#This tutorial summarizes how to seed a random class in C#. Thread Safe List in C#There are two main methods that can be used to create a thread-safe list in C#, the ConcurrentBag class, the ConcurrentQueue class, and the SynchronizedCollection class. How to Update Dictionary Value in C#This tutorial demonstrates how to update values in a C# dictionary by using a key as an index How to Get List Length in C#This tutorial demonstrates how to get the number of items in a C# List by using the count function How to Initialize Array of Objects in C#In this article, explains how to initialize an array of objects through Constructor parameters in C#. How to Convert IEnumerable to List in C#In this tutorial, learn the different methods of converting IEnumerable to list in C#. Use the ToList(), ToArray(), and AsEnumerable() method. Create Map and Reduce Functions in C#This tutorial elaborates how to create and use map and reduce functions in C#. Integer Division in C#This tutorial discussed the methods to perform integer division in C#. There are 3 types of divisions in C#: the integer division, the floating point division, and the decimal division. How to Convert a Dictionary to JSON String in C#This article teaches how to convert a Dictionary to a JSON string in C#. How to Format a String With Fixed Spaces in C#This tutorial explains how to format a string with fixed spaces or padding in C#. How to Convert Double to Decimal in C#This article will discuss converting a double to a decimal using the C# programming language. How to Get the Unix Timestamp in C#This how-to article shows different methods to get the unix timestamp in C#. It introduces methods like DateTime.Now.Subtract().TotalSeconds, DateTimeOffset.Now.ToUnixTimeSeconds() and TimeSpan Struct HashMap in C#This article introduces hashmap equivalent in C#. It includes Dictionary collection. How to Calculate the Difference Between Two Dates in C#Calculate difference between two dates (number of days) in C# How to Get Int Value From Enum in C#This tutorial demonstrates how to get int value from enum type in C# in several methods with thorough description and examples. How to Enumerate an Enum in C#This tutorial introduces how to enumerate an enum value in C# using different types of methods. How to Get Dictionary Value by Key in C#There are 2 main methods that can be used to get dictionary value with the key in C#, the [] method, and the TryGetValue() function.