1. 验证用户输入;
2. 转化必要的字符,避免脚本攻击;
3. 防止用户估计禁止掉浏览器中的Javascript进行提交。
4. 防止用户恶意频繁输入。
5. 防止广告机器人。

6. asp.net Ajax访问页面静态方法或WebService时,要注意是否需要进行身份验证。

    [WebMethod]
    public static bool DeleteMessage(int id)
    {
        if (!HttpContext.Current.User.Identity.IsAuthenticated)
        {
            throw new System.Security.SecurityException("没有权限.");
        }
        //do something.
    }
7. 禁止用户手动输入input[type="file"]的文件路径,最简单的方式是
<input type="file" ContentEditable="false" />

相关文章:

  • 2021-12-12
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
猜你喜欢
  • 2021-07-20
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2021-06-22
  • 2021-06-11
相关资源
相似解决方案