查询是否还有黑客代码的asp.net函数,非常适合留言簿、bbs、聊天室
<%@ Page language="vb"%>
<script runat="server">
dim heike(2) as string
dim i as integer
'定义黑客代码
public Sub heikeword(a as string)
heike(0)="1234"
heike(1)="125"
dim re as System.Text.RegularExpressions.Regex
for i=0 to 1
re=new System.Text.RegularExpressions.Regex(heike(i))
if(re.Match(a).Success)
response.write (heike(i)+" ")
response.write ("success")
end if
next
end sub
</script>
<%
dim a as string="1234345" '就是要检测的内容
heikeword(a)
%>
博客给出了一个用于查询是否存在黑客代码的ASP.NET函数,该函数用VB语言编写,适合留言簿、BBS、聊天室等场景,并给出了示例代码,定义了黑客代码数组,对输入内容进行匹配检测。
154

被折叠的 条评论
为什么被折叠?



