2009-09-02 43 views

回答

14

的几点:

  • 您需要的System.Web装配
  • 你需要获取类名称权(HttpServerUtility,不HttpServerUtuility
  • 引用您需要获取的方法名称权(UrlDecode,不URLDecode
  • 您需要的类的实例,因为它是一个实例方法

获取实例可能是最难的部分,除非您在ASP.NET中 - 它没有任何公共构造函数或静态属性来获取实例。通常你会使用HttpContext.Server。另一种方法是使用HttpUtility.UrlDecode,其中的一种静态方法。 (同样,你需要System.Web参考。)

5

添加对System.Web程序集的引用。

+1

然后键入HttpServerUtility,按 “CTRL +。”发挥魅力。 – RichardOD 2009-09-02 16:06:49

0

只好组件添加到我的网页API

System.Web 
System.Web.Abstractions 
System.Web.ApplicationServices