我尝试使用下面的代码:为什么我不能在类中使用HttpServerUtility.HtmlEncode?
string myString = HttpServerUtility.HtmlEncode("my link & details");
我收到以下错误:
An object reference is required for the nonstatic field, method, or property.
为什么我不能用HttpServerUtility.HtmlEncode
一个类里面呢?
这是一样的。 HttpServerUtility.HtmlEncode只是转发给HttpUtility.HtmlEncode – Rolf 2015-12-12 13:52:36