How To

How to check if a directory is empty in C#
By Tan Lee Published on Dec 25, 2024 994

In C#, there are a couple of straightforward ways to determine whether a directory is empty.

How to Append a file in C#
By Tan Lee Published on Jun 25, 2024 778

Appending data to a file in C# can be done using various methods provided by the .NET framework.

How to convert string to hex in C#
By Tan Lee Published on Nov 26, 2024 1.57K

To convert a string to its hexadecimal representation in C#, you can use the following method.

How to Convert a string to a double in C#
By Tan Lee Published on Feb 04, 2025 441

There are three common ways to convert a string to a double:

How to get project file path in C#
By Tan Lee Published on Nov 13, 2024 2.13K

In C#, you can get the project file path in different ways.

How to read XML in C#
By Tan Lee Published on Jan 17, 2025 648

Parsing XML in C# can be done using several approaches, each suitable for different scenarios depending on the complexity of the XML structure and performance requirements.

How to compress and decompress strings in C#
By Tan Lee Published on Dec 30, 2024 439

Compressing string data using compression algorithms like GZip and Brotli can help reduce memory payload and improve application performance.

How to restart program in C#
By Tan Lee Published on Nov 10, 2024 762

To restart a program in C#, you can achieve it by launching a new instance of the program and exiting the current instance.

Auth with multiple Identity Providers in ASP.NET Core
By Tan Lee Published on Mar 03, 2025 323

To authenticate with multiple identity providers in ASP.NET Core, you can configure different authentication schemes for each identity provider (such as Auth0, Azure AD, or OpenIddict) and handle token validation accordingly.

How to Implement Phone verification, 2FA using ASP.NET Core
By Tan Lee Published on Mar 03, 2025 117

To implement phone verification and Two-Factor Authentication (2FA) using ASP.NET Core, we can extend ASP.NET Core Identity and use an SMS provider to send verification codes.

How to Implement Passwordless Authentication in ASP.NET Core
By Tan Lee Published on Mar 03, 2025 250

Passwordless authentication is a method that allows users to authenticate without needing to remember and input a password. Instead, authentication is done through alternative methods like email, SMS, or biometrics, ensuring a more convenient and secure experience.

How to Find XML element by name with XElement in LINQ
By Tan Lee Published on Mar 01, 2025 96

The XElement class from LINQ-to-XML allows you to easily search for XML elements by name.