1, 输入输出的安全策略

输入
正则表达式System.Text.RegularExpressions.Regex类进行验证
Regex isNumber=new Regex("^[0-9]_$");
if(isNumber.Match(inputData))
{

//满足条件
}
else
{

//不满足条件
}


输出
任何数据在返回给用户前均采用HTML编码
使用System.Web.HttpServerUtility类中的HtmlEncode方法
SomeLabel.Text=Server.HtmlEncode(username);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-04-30
  • 2021-12-31
  • 2021-12-31
  • 2021-06-02
  • 2021-11-09
猜你喜欢
  • 2021-12-29
  • 2021-12-30
  • 2021-11-25
  • 2022-02-08
  • 2021-06-04
  • 2022-02-21
相关资源
相似解决方案