过滤sql语句

Posted shiyi2014

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了过滤sql语句相关的知识,希望对你有一定的参考价值。

#Region "过滤sql语句"
Public Shared Function denny(ByVal id) As String
id = Replace(id, "‘", "")
id = Replace(id, " and ", "")
id = Replace(id, "select ", "")
id = Replace(id, "update ", "")
id = Replace(id, " chr ", "")
id = Replace(id, " delete ", "")
id = Replace(id, "%20from", "")
id = Replace(id, ";", "")
id = Replace(id, "insert ", "")
id = Replace(id, " mid ", "")
id = Replace(id, "set", "")
id = Replace(id, "chr(37)", "")
id = Replace(id, "=", "")
id = Replace(id, "(", "")
id = Replace(id, "exec%20master.dbo.xp_cmdshell", "")
id = Replace(id, "xp_cmdshell", "")
id = Replace(id, "net localgroup administrators", "")
Return id
End Function
#End Region

以上是关于过滤sql语句的主要内容,如果未能解决你的问题,请参考以下文章

sql 查询语句中 如何过滤 指定的字符

sql语句查询过滤重复数据

sql语句问题,搜索前5000条数据再过滤

过滤sql语句

SQL语句执行顺序

SQL语句检索数据排序及过滤