.NET Core
If you are using .NET Core (either ASP .NET, a Class library or a Console App) or even .NET Standard, you can use one of these two methods:-
System.Web.HttpUtility.UrlDecode
OR
System.Net.WebUtility.UrlDecode
ASP .NET Framework
If you are inside an instance method of System.Web.Mvc.Controller, you can use the Server property as follows:-Server.UrlDecode
For any other class, you can use one of these:-System.Web.HttpUtility.UrlDecode
OR
System.Net.WebUtility.UrlDecode
.NET Framework Console/Desktop Application
For the remaining portions of the .NET platform like a .NET Framework Console Application, Class Library, Windows Service & Desktop Application you can use the following:-System.Net.WebUtility.UrlDecode
On a side note, you can try my online URL Decoder.
No comments:
Post a Comment