Search

How to read and write to text file in C#
By Tan Lee Published on Jul 04, 2017 11.31K

In C#, reading from and writing to a text file can be done using classes in the System.IO namespace, such as StreamReader, StreamWriter, File, and FileInfo.

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

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

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 Connect to a MySQL database in C#
By Tan Lee Published on Mar 07, 2025 171

The easiest way to connect to a MySQL database in a .NET project is by using the MySql.Data package (from Oracle).

Read more
How to read the Description attribute in C#
By Tan Lee Published on Mar 07, 2025 137

The Description attribute in C# can be used to provide descriptive information about types and their members (such as properties and methods). A common use case is associating user-friendly descriptions with enum values.

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 read problem details JSON with HttpClient in C#
By Tan Lee Published on Mar 07, 2025 236

When working with APIs, error responses are often standardized using the Problem Details format (RFC7807), which has a Content-Type of application/problem+json.

Read more
How to Get Status Codes with HttpClient in C#
By Tan Lee Published on Mar 06, 2025 493

When using HttpClient to send requests, you can easily access the status code from the HttpResponseMessage object.

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 Get key with the max value in a dictionary in C#
By Tan Lee Published on Mar 06, 2025 534

The simplest way to retrieve the key with the maximum value in a dictionary is to use the Linq MaxBy() method (available since .NET 6).

Read more
How to use NCache in ASP.NET Core
By Tan Lee Published on Jan 07, 2025 149

Although ASP.Net Core doesn't include a cache object, it supports various caching methods, such as in-memory caching, distributed caching, and response caching.

Read more
Hashtable vs Dictionary in C#
By Tan Lee Published on Jan 07, 2025 215

The Microsoft .NET Framework offers strong support for working with collections, which are used to store and retrieve data.

Read more
How to use Fluent NHibernate in C#
By Tan Lee Published on Jan 07, 2025 499

Fluent NHibernate is an Object-Relational Mapping (ORM) framework that simplifies data access by allowing developers to perform CRUD (Create, Read, Update, Delete) operations without directly interacting with the database.

Read more
How to use HashSet in C#
By Tan Lee Published on Jan 06, 2025 292

The HashSet is a high-performance collection used for storing unique, unordered elements, designed to speed up search operations in applications.

Read more
How to use Task.WhenEach in C#
By Tan Lee Published on Jan 05, 2025 376

The upcoming .NET 9 release introduces the Task.WhenEach method, allowing developers to handle asynchronous tasks more efficiently.

Read more
How to use Brotli for response compression in ASP.NET Core
By Tan Lee Published on Jan 04, 2025 448

Using content compression in RESTful services with ASP.NET Core Web API can improve performance by reducing bandwidth usage and speeding up responses.

Read more
How to use SignalR in ASP.NET Core
By Tan Lee Published on Jan 04, 2025 423

SignalR for ASP.Net Core is an updated library that enables real-time communication in ASP.NET Core applications, allowing the server to push updates to connected clients immediately without the clients needing to request them.

Read more
How to use the Dapper ORM in ASP.NET Core
By Tan Lee Published on Jan 04, 2025 238

Dapper is an open-source, lightweight "micro ORM" that simplifies data access in applications. It supports various databases like SQL Server, MySQL, SQLite, SQL CE, and Firebird, offering high performance while maintaining ease of use.

Read more
How to use configuration providers in ASP.NET Core
By Tan Lee Published on Jan 04, 2025 212

ASP.NET Core enables flexible and modular configuration management through configuration providers and dependency injection, promoting a loosely coupled architecture.

Read more
How to use Autofac in ASP.Net Core
By Tan Lee Published on Jan 03, 2025 301

Dependency injection in ASP.Net Core helps achieve loose coupling, enhancing testability and maintainability.

Read more
How to make a File Explorer in C#
By Tan Lee Published on Jul 15, 2017 11.57K

Creating a File Explorer in C# using Windows Forms involves building a UI with components such as WebBrowser, and potentially a TextBox or Label for displaying the file path.

Read more
If else condition in sql server
By Tan Lee Published on Dec 03, 2024 319

In SQL Server, the IF ELSE statement is used to execute one block of SQL code if a condition is true, and another block of code if the condition is false.

Read more
How to create a Web Browser with Tabs in C#
By Tan Lee Published on Jul 04, 2017 12.45K

Creating a simple web browser with tabs in C# can be done using the WebBrowser control.

Read more
How to make a Countdown Timer in C#
By Tan Lee Published on Jul 11, 2017 17.41K

Creating a countdown timer in C# can be done using a System.Timers.Timer.

Read more
How to Copy file with progress bar in C#
By Tan Lee Published on Feb 20, 2024 18.88K

Copying a file with a progress bar in a C# Windows Forms Application involves several steps, including setting up the UI components, handling the file copy operation, and updating the progress bar accordingly.

Read more
How to Download a File from Internet in C#
By Tan Lee Published on Jun 25, 2017 15.56K

Downloading a file from the internet in C# can be done using the HttpClient class or the WebClient class.

Read more
How to create a search box in C# WinForms
By Tan Lee Published on Nov 20, 2024 709

Creating a search box for a Windows Forms application, similar to the one in the Windows 11.

Read more
Motiv MUI React Admin Dashboard Template
By Tan Lee Published on Nov 19, 2024 530

Motiv., designed by Rushit Dhameliya for the Figma Design Community, is an admin dashboard template built with the Material UI framework. It features numerous pre-built, responsive components that are easily customizable.

Read more
How to fix PowerToys FancyZones in Windows 11
By Tan Lee Published on Nov 19, 2024 433

How to fix an issue where FancyZones (part of the PowerToys toolset) fails to work properly due to conflicts with Windows 11's built-in window management.

Read more
Admin One Tailwind CSS HTML5 Dashboard Template
By Tan Lee Published on Nov 18, 2024 446

Admin One is a free admin dashboard template built with Tailwind CSS, a utility-first CSS framework that enables rapid UI development.

Read more