HttpUtility.HtmlEncode这个函数可以让s变成没有攻击的代码,可以提升网站的安全性
  1. public string Index(string s = "suepr name is null")
  2. {
  3. //Speak();
  4. //return View();
  5. return "I have review it"+HttpUtility.HtmlEncode( s);
  6. return "I have review it"+Server.HtmlEncode( s); //同上一样的功能
  7. }

05-28 13:40