Search

How to Encode and Decode URL in C#
By Tan Lee Published on Dec 11, 2024 1.61K

In C#, URL encoding and decoding can be performed using the System.Net.WebUtility class or System.Uri class.

Read more
Build a server-side web app with HTMX in C#
By Tan Lee Published on Feb 07, 2025 218

Combine .NET with C# and HTMX for a smooth development experience that delivers dynamic front-end interactivity without any JavaScript.

Read more
How to Use HttpClient to GET JSON from API endpoint in C#
By Tan Lee Published on Jan 09, 2025 460

Why not create a method that can make a GET request to an API and directly return the response as an object?

Read more
JWT Token Expiry Timestamp in C#
By Tan Lee Published on Jan 10, 2025 569

To decode a JWT token and extract its expiration time (expiry), you can follow these steps in C#.

Read more
How to Send x-www-form-urlencoded Data with HttpClient in C#
By Tan Lee Published on Jan 09, 2025 702

To post x-www-form-urlencoded data in C# using HttpClient, you can follow these steps:

Read more
Sorting a SortedList in Descending Order in C#
By Tan Lee Published on Feb 07, 2025 187

In C#, the SortedList class stores key-value pairs in ascending order of the key by default. If you need to store the elements in descending order, you can achieve this by using a custom comparer.

Read more
Difference between delegate and event in C#
By Tan Lee Published on Feb 07, 2025 235

In C#, both delegates and events are essential constructs for handling method references and providing a way to notify subscribers when something happens.

Read more
How to calculate code execution time in C#
By Tan Lee Published on Feb 07, 2025 332

To calculate the code execution time in C#, you can use the Stopwatch class from the System.Diagnostics namespace.

Read more
How to Read a File Using StreamReader in C#
By Tan Lee Published on Feb 07, 2025 243

To read a file in C#, you can use the StreamReader class. It simplifies reading text from a file by providing various methods for reading data.

Read more
Difference Between Hashtable and Dictionary in C#
By Tan Lee Published on Feb 07, 2025 198

In C#, both Hashtables and Dictionaries are popular collections used for storing and retrieving key-value pairs.

Read more