`

防止SQL注入攻击

    博客分类:
  • .NET
阅读更多
看了本期ASP。NET杂志里的一篇讲防止SQL注入攻击的文章,里面讲的不错,摘录其中一段防范的函数如下
Function SafeRequest(ParaName,ParaType)
--- 传入参数 ---‘ParaName:
参数名称-字符型‘ParaType:参数类型-数字型(1表示以上参数是数字,0表示以上参数为字符)
Dim ParaValueParaValue=Request(ParaName)
If ParaType=1 then
If not isNumeric(ParaValue) then
Response.write “参数” & ParaName & “必须为数字型!”
Response.end
End if
ElseParaValue=replace(ParaValue," ' "," ''")
End if
SafeRequest=ParaValue
End function
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics