How To

How to Calculate Week Number from DateTime in C#
By Tan Lee Published on Jan 09, 2025 357

Calculating the week number is more complex than it initially seems.

Using HttpClient with Sync and Async in C#
By Tan Lee Published on Jan 09, 2025 427

The System.Net.Http.HttpClient() provides a robust HTTP client, but using it can be a challenge, especially if you're not familiar with asynchronous programming like I wasn't.

Unable to read data from the transport connection: The connection was closed
By Tan Lee Published on Jan 09, 2025 195

If you get an error when attempting to retrieve an image via a WebRequest, the error message is shown below.

HttpClient POST or PUT Json with content type application/json
By Tan Lee Published on Jan 09, 2025 217

The HttpClient is a modern and flexible way to interact with URLs, whether you're retrieving data or sending it.

How to use HttpClient and IHttpClientFactory in .NET Core
By Tan Lee Published on Jan 09, 2025 361

When working with APIs in C#, the HttpClient class is essential for making HTTP requests such as GET, PUT, POST, or DELETE.

How to Get Total Physical RAM in C#
By Tan Lee Published on Jan 08, 2025 427

Retrieving the total installed physical memory (RAM) on the system is straightforward.

How to handle 404 errors in ASP.NET Core
By Tan Lee Published on Jan 08, 2025 308

ASP.NET Core MVC is a framework for building cross-platform, scalable web applications and APIs using the Model-View-Controller pattern.

Export DataTable To Excel in C#
By Tan Lee Published on Jan 08, 2025 501

In this article, I introduce a utility for exporting a DataTable to an Excel file in C# using the Interop method.

C# Export to Excel
By Tan Lee Published on Jan 08, 2025 226

Working with various Excel spreadsheet formats and utilizing C# export functionalities is essential for many projects.

Sending Emails in C#
By Tan Lee Published on Jan 08, 2025 310

Sending emails is often not a favorite task for developers, though almost every system requires it.

Sending Emails in C# using MailKit
By Tan Lee Published on Jan 08, 2025 498

MailKit is a robust open-source .NET library designed for sending and receiving emails. We use it as an alternative to the SmtpClient class from the System.Net.Mail namespace.

How to implement a distributed cache in ASP.NET Core
By Tan Lee Published on Jan 07, 2025 277

ASP.Net Core offers support for various caching techniques, including in-memory caching, response caching, and built-in distributed caching.