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 moreHow 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 moreHow 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 moreHow 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 moreHow 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 moreHow 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 moreHow 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 moreHow 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 moreHow 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 moreHow 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 moreHow 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 moreHashtable 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 moreHow 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 moreHow 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 moreHow 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 moreHow 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 moreHow 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 moreHow 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 moreHow 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 moreHow 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 moreHow 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 moreIf 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 moreHow 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 moreHow 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 moreHow 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 moreHow 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 moreHow 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 moreMotiv 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 moreHow 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 moreAdmin 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