How to Html Encode a string in a c# windows application?
Posted by mundeep on August 21, 2008
To HtmlEncode a string from within a Windows application you need to make sure that:
1) You have a reference to System.Web
2) You use the System.Web.HttpUtility.HtmlEncode method.
For example:
using System.Web;
public string MyHtmlEncode(string inputString) {
return HttpUtility.HtmlEncode(inputString);
}