How To
How to compress and decompress strings in C#
12/30/2024 3:16:32 AM 224
Compressing string data using compression algorithms like GZip and Brotli can help reduce memory payload and improve application performance.
How to convert file data to byte array in C#
12/30/2024 3:14:49 AM 239
If you're uploading a ZIP file to Azure Blob Storage, you would first need to convert the file into a byte array.
How to get Url Referrer in ASP.NET Core
12/27/2024 8:34:57 AM 687
In ASP.NET Core, the referrer URL (the page that made the request) can be retrieved from the `Request.Headers` collection, where it is stored under the `Referer` header.
How to get HttpContext.Current in ASP.NET Core
12/27/2024 8:31:40 AM 292
In ASP.NET Core, `HttpContext.Current` was removed. Instead, `HttpContext` is injected into services, controllers, and middleware via dependency injection, and can be accessed using the `IHttpContextAccessor` interface.
How to read Configuration Values from appsettings.json in ASP.NET Core
12/27/2024 8:01:50 AM 671
To access the values from the configuration file, you need to set up a configuration system in the Startup.cs class.
How to add link parameter to asp tag helpers in ASP.NET Core
12/27/2024 7:25:54 AM 254
You can use the asp-route- attribute prefix to specify route parameters in ASP.NET Core tag helpers.
How to set json serializer settings in ASP.NET Core
12/27/2024 7:13:59 AM 268
In ASP.NET Core, you can configure JSON serializer settings for your application in a few different ways, typically through the Startup.cs or Program.cs file.
How to Remove ASP.NET server headers
12/27/2024 6:54:50 AM 171
IIS (Internet Information Services) web server sometimes sends HTTP headers that can disclose sensitive server information.
Avoiding the Common Pitfalls of the == Operator in C#
12/27/2024 3:23:20 AM 174
If you encounter an issue with the equality operator (==), specifically when comparing values of different types, extra caution is needed.
How to prevent flicker in WinForms
12/27/2024 3:22:26 AM 177
If you often update the content of a WinForms Control, you may encounter a flickering problem, particularly when the data being displayed is large.
How to Remove Response Headers in IIS
12/27/2024 3:13:15 AM 300
To remove or modify ASP.NET server headers such as X-AspNet-Version and X-Powered-By, you can use different methods depending on your version of ASP.NET and which headers you want to modify.
Pass reference type using "ref"
12/27/2024 2:52:41 AM 129
When working with reference types in C#, passing them to methods allows modifications to the object’s properties within the method.