How To
How to Prevent CSRF Attacks in ASP.NET Core
By Tan Lee Published on Feb 03, 2025 235
Cross-site request forgery (CSRF) is a type of attack where a malicious user tricks an authenticated user into performing unwanted actions on a web application.
How to use Filters in ASP.NET Core
By Tan Lee Published on Feb 03, 2025 153
Filters in ASP.NET Core allow developers to execute code at specific stages in the request processing pipeline. This enables running code either before or after specific phases of the pipeline, such as executing actions, handling authorization, or generating results.
Preventing Redundant DI Code in ASP.NET Core
By Tan Lee Published on Feb 03, 2025 124
When working with controllers in ASP.NET Core or ASP.NET Core MVC applications, you may encounter repetitive code related to dependency injection (DI).
How to Read Request Headers in ASP.NET Core
By Tan Lee Published on Feb 03, 2025 281
ASP.NET Core MVC is a lightweight, open-source framework built on top of the ASP.NET Core 5 runtime. It provides support for handling request and response headers, which are collections of key-value pairs exchanged between the server and the client.
How to Use BitArray in .NET
By Tan Lee Published on Feb 03, 2025 168
The BitArray class in .NET 7 is a versatile and efficient data structure for storing and manipulating bits of data. Each element in a BitArray holds a single bit, represented as a boolean value (false for 0 and true for 1).
How to Implement Resource-Based Authorization in ASP.NET Core
By Tan Lee Published on Feb 03, 2025 210
In this article, we will explore how to implement resource-based authorization in ASP.NET Core to enforce fine-grained access control over resources in scenarios that attribute-based authorization cannot handle.
Serial Port Communication in C#
By Tan Lee Published on Jan 08, 2025 1.45K
The SerialPort class in C# enables communication with a serial port in .NET. This article demonstrates how to send and receive data through a serial port, displaying the received data in a TextBox using threading.
How to Optimize StringBuilder Performance in C#
By Tan Lee Published on Feb 01, 2025 177
Strings in .NET are immutable, meaning that modifying a string creates a new object in memory, which can lead to performance issues.
How to launch browser and visit web site in C#
By Tan Lee Published on Oct 29, 2024 1.45K
To launch a web browser and visit a website in C#, you can use the System.Diagnostics.Process class.
How to Parse a Comma-Separated String from App.config in C#
By Tan Lee Published on Dec 20, 2024 476
In this article, I'll walk you through how to parse comma-separated integer values from app.config and load them into a HashSet for efficient lookups.
How to fix 'The transaction log for the database is null due to OLDEST_PAGE'
By Tan Lee Published on Feb 16, 2024 610
The error 'The transaction log for the database is null due to 'OLDEST_PAGE' in SQL Server typically indicates a situation where the transaction log is corrupted or there is an issue with the log file structure.
Optimizing WCF Services for Performance and Scalability
By Tan Lee Published on Jan 22, 2025 107
WCF (Windows Communication Foundation) is a robust programming framework designed for building, configuring, and deploying network-distributed services.