Search

Primitive types in C#
By Tan Lee Published on Nov 10, 2024 830

In C#, primitive types are the basic types provided by the language, which represent simple values such as numbers, characters, and boolean values.

Read more
How to set permissions for a directory in C#
By Tan Lee Published on Dec 25, 2024 855

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.

Read more
How to Convert Int to Byte Array in C#
By Tan Lee Published on Jan 20, 2025 523

When working with integers in C#, you might encounter situations where you need to convert an integer to a byte array.

Read more
How to Convert string list to int list in C#
By Tan Lee Published on Feb 05, 2025 555

To convert a list of strings to a list of integers in C#, you can use several approaches.

Read more
How to Open and Show a PDF file in C#
By Tan Lee Published on Jul 31, 2017 17.32K

To embed and display a PDF file in a Windows Forms application using C# and Adobe Acrobat Reader, you can use the Adobe Acrobat Reader ActiveX control.

Read more
How to Download Youtube Video in C#
By Tan Lee Published on Jun 20, 2024 27.81K

To download a video from YouTube in a C# Windows Forms Application using the YoutubeExtractor library, you can follow these steps.

Read more
How to convert timestamp to date in C#
By Tan Lee Published on Nov 16, 2024 733

In C#, to convert a timestamp to a DateTime object, you can use the DateTimeOffset or DateTime class.

Read more
How to Get all files in a folder in C#
By Tan Lee Published on Dec 24, 2024 1K

If you need to get all files in a folder, there are two primary ways to do it: using Directory.GetFiles() and Directory.EnumerateFiles().

Read more
How to Convert Unix Timestamp to DateTime in C#
By Tan Lee Published on Jul 11, 2024 2.11K

In .NET, you can easily convert Unix timestamps to DateTime objects by using DateTimeOffset.FromUnixTimeSeconds method.

Read more
How to use Channel as an async queue in C#
By Tan Lee Published on Mar 21, 2025 195

The Channel class from System.Threading.Channels provides a non-blocking, asynchronous queue that implements the producer-consumer pattern.

Read more
How to round up in Javascript
By Tan Lee Published on Dec 18, 2024 157

To round up a number in JavaScript, you can use the `Math.ceil()` function.

Read more
How to round down in Javascript
By Tan Lee Published on Dec 18, 2024 161

To round down a number in JavaScript, you can use the `Math.floor()` method. This method returns the largest integer less than or equal to the given number.

Read more
How to use Progress Bar in C#
By Tan Lee Published on Feb 20, 2024 8.56K

To implement a progress bar using the Task Parallel Library in C#, you'll typically use a Progress object to report progress from a background task to the UI thread.

Read more
How to use BackgroundWorker in C#
By Tan Lee Published on Jun 01, 2017 7.91K

The BackgroundWorker class in C# is used for running operations on a separate, dedicated thread in the background, allowing the UI to remain responsive.

Read more
Free Responsive HTML5 & CSS3 Login Page
By Tan Lee Published on Nov 11, 2024 844

A free, responsive HTML5 and CSS3 login page built with Bootstrap 4 and enhanced with ParticlesJS for dynamic background effects.

Read more
How to allow and manipulate downloads in Cefsharp
By Tan Lee Published on Jul 02, 2024 1.2K

CefSharp is a .NET library that wraps around the Chromium Embedded Framework, allowing you to embed Chromium-based browsers in .NET applications.

Read more
How to disable printing in Cefsharp
By Tan Lee Published on Jun 29, 2024 759

To disable printing in CefSharp, which is a .NET wrapper around the Chromium Embedded Framework (CEF), you typically need to modify the settings of the CefSettings object when initializing CefSharp in your application.

Read more
How to add background image in css
By Tan Lee Published on Jun 13, 2024 344

To add a background image in css, you can use the background-image property.

Read more
How to use Dependency Injection in ASP.NET Core
By Tan Lee Published on Feb 18, 2024 448

ASP.NET Core is designed from the ground up to support and leverage dependency injection

Read more
Duplicate 'AssemblyVersion' attribute in C#
By Tan Lee Published on Mar 20, 2025 131

When you try to add the AssemblyVersion attribute to your project, for example, to auto-increment the version:

Read more
How to use a list of tuples in C#
By Tan Lee Published on Mar 05, 2025 396

In C#, a list of tuples can be used to store a collection of data where each element contains multiple values.

Read more
How to Print a Picture Box in C#
By Tan Lee Published on Jul 16, 2024 20.82K

Printing an image from a PictureBox control in a C# Windows Forms Application involves several steps, including setting up a PrintDocument, handling the print page event, and managing printing settings.

Read more
SQL Bulk Insert with SqlBulkCopy in C#
By Tan Lee Published on Mar 19, 2025 140

When dealing with a large number of records, especially in scenarios where inserting a lot of data into the database, a Bulk Insert can drastically improve performance over executing individual INSERT statements. Bulk Insertion can be up to 20x faster than inserting records one by one.

Read more
How to Update appsettings.json in C#
By Tan Lee Published on Mar 06, 2025 431

To update values programmatically within a settings JSON file, you will need to overwrite the entire settings.json file.

Read more
How to send a file with HttpClient in C#
By Tan Lee Published on Mar 11, 2025 348

When uploading a file with HttpClient, you need to place the file inside a MultipartFormDataContent object, which will be sent as the body of the HTTP request.

Read more
How to Insert Update Delete View and Search data from SQL Server in C#
By Tan Lee Published on Jun 01, 2017 13.34K

How to Insert Update Delete View and Search data from SQL Server in C#

Read more
How to update UI from another thread in C#
By Tan Lee Published on Dec 21, 2024 2.37K

In C#, you cannot directly update the UI from a background thread because Windows Forms and WPF (UI frameworks) require UI updates to happen on the main UI thread.

Read more
Serialize and Deserialize a Multidimensional Array in JSON using C#
By Tan Lee Published on Dec 25, 2024 1.09K

By default, System.Text.Json does not support serializing or deserializing multidimensional arrays.

Read more
Applying Migrations Programmatically in EF Core
By Tan Lee Published on Feb 06, 2025 159

In EF Core, migrations are used to create the database, apply schema changes, and update tables.

Read more
Using GROUP BY with ORDER BY in SQL
By Tan Lee Published on Mar 07, 2025 199

The GROUP BY clause groups rows based on one or more columns, while the ORDER BY clause sorts rows. You can combine these two to sort the groups themselves.

Read more
How to Copy data from one table to another in SQL
By Tan Lee Published on Mar 07, 2025 309

To copy data from one table to another, you can use the INSERT INTO SELECT statement with a column list:

Read more
How to Deserialize JSON with a specific constructor in C#
By Tan Lee Published on Mar 07, 2025 405

When your class has multiple constructors, the JsonConstructor attribute allows you to specify which one to use during JSON deserialization.

Read more
Only one parameter per action may be bound from body in ASP.NET Core
By Tan Lee Published on Mar 07, 2025 268

When working with web APIs in ASP.NET Core, you might encounter an error when multiple parameters in your action method are bound to the request body.

Read more
How to use SortedSet in C#
By Tan Lee Published on Mar 07, 2025 147

If you need to maintain a collection of elements that must always stay in sorted order while continuously adding new ones, the SortedSet class in C# is an excellent choice.

Read more
How to Call a constructor from another constructor in C#
By Tan Lee Published on Mar 07, 2025 176

In C#, when you need to call one constructor from another, you can use constructor chaining syntax.

Read more
How to use TimeZoneInfo in C#
By Tan Lee Published on Mar 06, 2025 484

Time zones can be tricky due to their varying rules and changes, so leveraging a library is a smart approach. In .NET, one such option is the built-in TimeZoneInfo class.

Read more
How to use JsonExtensionData in C#
By Tan Lee Published on Mar 06, 2025 274

The JsonExtensionData attribute (from System.Text.Json) is useful for deserializing properties that don't match your class structure. Without this attribute, any extra JSON fields will be ignored, leading to null properties in the resulting object.

Read more
TimeZoneInfo with current UTC offset in C#
By Tan Lee Published on Mar 06, 2025 210

TimeZoneInfo provides the base UTC offset, which can lead to confusion since the offset may vary depending on the date due to daylight saving time.

Read more
How to Parser a CSV file in C#
By Tan Lee Published on Mar 06, 2025 227

Parsing a CSV file in C# can be done in a few different ways depending on your needs.

Read more
How to Encrypt and Decrypt plain string using ROT13 in C#
By Tan Lee Published on Jun 21, 2024 8.64K

Encrypting and decrypting using ROT13 in C# is straightforward due to its simplicity. ROT13 is a simple substitution cipher that replaces each letter with the letter 13 positions after it in the alphabet.

Read more
How to make a placeholder for a 'select' box
By Tan Lee Published on Mar 02, 2024 404

This post shows you How to make a placeholder for a 'select' box.

Read more
How to replace Request.IsAjaxRequest() in ASP.NET Core
By Tan Lee Published on Feb 18, 2024 730

This post shows you how to replace Request.IsAjaxRequest() in ASP.NET Core

Read more
Windows Forms: Circle Progress Bar in C#
By Tan Lee Published on May 30, 2017 12.67K

How to create Circle/Circular Progress Bar in C#. Circular ProgressBar is a custom control and inplace replacement of 'ProgressBar' for WinForm with animation

Read more