zoukankan
html css js c++ java
SQL注入过滤
Code
SQL注入
#region
SQL注入
public
static
void
SQLZ()
{
HttpContext.Current.Request.QueryString;
CheckSQLZ(HttpContext.Current.Request.QueryString);
}
private
static
void
CheckSQLZ(System.Collections.Specialized.NameValueCollection qs)
{
if
(qs.Count
>
0
)
{
for
(
int
i
=
0
; i
<
qs.Count; i
++
)
{
if
(
!
Z(qs[i].ToLower()))
{
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Write(
"
您好,SQL注入?
"
);
HttpContext.Current.Response.End();
}
}
}
}
private
static
string
[] al
=
"
;|and|1=1|exec|insert|select|delete|update|like|count|chr|mid|master|or|truncate|char|declare|join
"
.Split(
'
|
'
);
public
static
bool
Z(
string
v)
{
if
(v.Trim()
!=
""
)
{
foreach
(
string
a
in
al)
{
if
(v.IndexOf(a
+
"
"
)
>
-
1
||
v.IndexOf(
"
"
+
a)
>
-
1
)
{
return
false
;
}
}
}
return
true
;
}
#endregion
本人在长沙, 有工作可以加我QQ4658276
查看全文
相关阅读:
项目准备和启动——项目投标
项目准备和启动——项目可行性分析
项目准备和启动——项目建议书
软件项目管理
项目管理知识体系
项目的生命周期
项目管理基本方法
什么是项目管理?
Python基础学习——第一弹
redis
原文地址:https://www.cnblogs.com/jianjialin/p/1371961.html
最新文章
C#控制台应用程序——穷举&迭代
面向对象实例
python面向对象
python字符串
python字典
python---6
python---5
决策树算法
python---4
python---3
热门文章
python---2
python报错
使用sumifs进行多条件求和
20190919—1
20190919
excel中收缩和展开行的设置
20190907—in/not in的用法
20190810—while函数用法
20190810—random函数用法汇总
项目准备和启动——软件项目合同条款评审
Copyright © 2011-2022 走看看