螺螺的blog
父母一天天老去了,我要努力!
众所周知,.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"+ "'";
posted on 2008-04-12 16:59  luoluo  阅读(670)  评论(2编辑  收藏  举报