How To
Primitive types in C#
By Tan Lee Published on Nov 10, 2024 1.05K
In C#, primitive types are the basic types provided by the language, which represent simple values such as numbers, characters, and boolean values.
How to set permissions for a directory in C#
By Tan Lee Published on Dec 25, 2024 1.15K
When working with files and directories in C#, you may need to set or modify permissions for a specific directory, including its files and subdirectories.
How to Convert Int to Byte Array in C#
By Tan Lee Published on Jan 20, 2025 751
When working with integers in C#, you might encounter situations where you need to convert an integer to a byte array.
How to Convert string list to int list in C#
By Tan Lee Published on Feb 05, 2025 815
To convert a list of strings to a list of integers in C#, you can use several approaches.
How to Pass string parameter in an onclick function
By Tan Lee Published on Feb 16, 2024 1.96K
To pass a parameter using the onclick event in HTML, you can define a JavaScript function that accepts parameters and call it from the onclick attribute.
How to convert timestamp to date in C#
By Tan Lee Published on Nov 16, 2024 904
In C#, to convert a timestamp to a DateTime object, you can use the DateTimeOffset or DateTime class.
How to Get all files in a folder in C#
By Tan Lee Published on Dec 24, 2024 1.34K
If you need to get all files in a folder, there are two primary ways to do it: using Directory.GetFiles() and Directory.EnumerateFiles().
How to Convert Unix Timestamp to DateTime in C#
By Tan Lee Published on Jul 11, 2024 2.42K
In .NET, you can easily convert Unix timestamps to DateTime objects by using DateTimeOffset.FromUnixTimeSeconds method.
How to use Channel as an async queue in C#
By Tan Lee Published on Mar 21, 2025 330
The Channel class from System.Threading.Channels provides a non-blocking, asynchronous queue that implements the producer-consumer pattern.
Case sensitivity in JSON deserialization
By Tan Lee Published on Mar 21, 2025 440
By default, Newtonsoft.Json uses case-insensitive deserialization, while System.Text.Json performs case-sensitive deserialization.
The JSON value could not be converted to Enum
By Tan Lee Published on Mar 21, 2025 464
When using System.Text.Json to deserialize JSON that includes a string representation of an enum, you may encounter the following error:
Case insensitive dictionary in C#
By Tan Lee Published on Jan 21, 2025 473
Dictionaries in C# are case sensitive by default when using string keys.