How To

How to delete a file in C#
By Tan Lee Published on Jun 11, 2024 467

In C#, you can delete a file using the File.Delete() method from the System.IO namespace.

How to decrypt a file in C#
By Tan Lee Published on Jun 11, 2024 440

In C#, you can encrypt and decrypt a file using the FileInfo class from the System.IO namespace.

How to use File.OpenWrite in C#
By Tan Lee Published on Jun 11, 2024 698

In C#, the File.OpenWrite method is used to open an existing file or create a new file for writing.

How to fix Using 'UseMvc' to configure MVC is not supported while using Endpoint Routing
By Tan Lee Published on Jun 10, 2024 1.23K

How to solve the problem Using 'UseMvc' to configure MVC is not supported while using Endpoint Routing when changing ASP.NET Core 2.2 to 3.0

How to Increase upload file size in ASP.NET Core
By Tan Lee Published on Jun 10, 2024 815

To increase the upload file size in ASP.NET Core, you typically need to adjust settings in both your application code and your server configuration.

How to return 401 instead of 302 in ASP.NET Core
By Tan Lee Published on Jun 10, 2024 943

Sometimes you add an [Authorize] attribute to your web API method in ASP.NET Core 2.0 and instead of returning 401, it returns 302.

How to Open password protected Word Document without software
By Tan Lee Published on Jun 08, 2024 497

Recovering your Word document lost password with VBA code.

How to drop table if exists in sql server
By Tan Lee Published on May 31, 2024 717

In SQL Server, you can drop a table if it exists by first checking if the table exists in the database, then dropping it if the existence check returns true.

How to set culture to change datetime format in ASP.NET MVC
By Tan Lee Published on May 29, 2024 1.31K

How to fix String was not recognized as a valid DateTime 'dd/MM/yyyy'

How to fix Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager'
By Tan Lee Published on May 25, 2024 1.93K

How to fix Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UserManager'

How to use Autofac for Dependency Injection in ASP.NET MVC
By Tan Lee Published on May 22, 2024 617

Using Autofac for Dependency Injection in ASP.NET MVC

How to fix 'The specified directory for the INSTALLSHAREDDIR parameter is not valid'
By Tan Lee Published on May 21, 2024 969

How to fix 'The specified directory, “C:\Program Files (x86)\Microsoft SQL Server\”, for the INSTALLSHAREDDIR parameter is not valid because this directory is compressed or is in a compressed directory. Specify a directory that is not compressed.'