How To
‘SHA256Managed’ is obsolete: ‘Derived cryptographic types are obsolete
By Tan Lee Published on Jan 09, 2025 640
Warning SYSLIB0021 'SHA512Managed' is obsolete: 'Derived cryptographic types are obsolete. Use the Create method on the base type instead.'
How to Calculate Week Number from DateTime in C#
By Tan Lee Published on Jan 09, 2025 672
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 664
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 365
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 428
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 666
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 681
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 519
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 751
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 435
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 562
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 776
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.