不要被String.Format欺骗
跟那个预编译可不是一回事。
引用至 luoluo
众所周知,.net使用参数的方式可以避免注入的问题,但是审核代码时注意不要被String.Format格式化字符串的代码欺骗:
String sql = String.Format("select * from [users] where username='{0}'", Request.QueryString["username"]);
这个代码等价于:
String sql = "select * from [users] where username='" + Request.QueryString["username"] + "'";
评论Feed: http://www.neeao.com/blog/feed.asp?q=comment&id=5096
这篇日志没有评论.




