I'm trying to call the HttpServerUtuility.URLDecode function in C# using Visual Studio 2005, but it can't be found. I'm using System.Web
properly, but the class doesn't seem to be there. Do I need to add some sort of reference to my project?
A few points:
System.Web
assembly HttpServerUtility
, not HttpServerUtuility
) UrlDecode
, not URLDecode
) Getting an instance is likely to be the hardest part, unless you're in ASP.NET - it doesn't have any public constructors or a static property to fetch an instance. Usually you'd use HttpContext.Server
. An alternative is to use HttpUtility.UrlDecode
, which is a static method. (Again, you'll need a reference to System.Web
.)
添加对System.Web程序集的引用。
Had to add assemblies to my web api
System.Web
System.Web.Abstractions
System.Web.ApplicationServices
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.