首页 > 代码库 > HttpUtility.HtmlEncode

HttpUtility.HtmlEncode

 HttpUtility.HtmlEncode用来防止站点受到恶意脚本注入的攻击

public string Welcome(string name, int numTimes = 1) {
     return HttpUtility.HtmlEncode("Hello " + name + ", NumTimes is: " + numTimes);
}

 

HttpUtility.HtmlEncode