看了本期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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2021-08-05
  • 2021-09-28
  • 2021-06-15
  • 2021-12-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2022-01-13
  • 2022-12-23
相关资源
相似解决方案