当前位置: 网学 > 编程文档 > ASP > 正文

newasp中main类

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 13/06/17
lStr, "----", "")
HtmlStr = Replace(HtmlStr, "////", "")
HtmlStr = Replace(HtmlStr, "\\\\", "")
HtmlStr = Replace(HtmlStr, "####", "")
HtmlStr = Replace(HtmlStr, "@@@@", "")
HtmlStr = Replace(HtmlStr, "****", "")
HtmlStr = Replace(HtmlStr, "~~~~", "")
Set re = New RegExp
re.IgnoreCase = True
re.Global = True
re.Pattern = "\[br\]"
HtmlStr = re.Replace(HtmlStr, "")
re.Pattern = "\[align=right\](.*)\[\/align\]"
HtmlStr = re.Replace(HtmlStr, "")
re.Pattern = "<(.[^>]*)>"
HtmlStr = re.Replace(HtmlStr, "")
Set re = Nothing
HtmlStr = Replace(HtmlStr, ">", ">")
HtmlStr = Replace(HtmlStr, "<", "<")
l = Len(HtmlStr)
If l >= strLen Then
strContent = Left(HtmlStr, strLen) & "..."
Else
strContent = HtmlStr & " "
End If
strContent = Replace(strContent, Chr(34), """)
strContent = Replace(strContent, Chr(39), "'")
strContent = Replace(strContent, Chr(36), "$")
strContent = Replace(strContent, Chr(123), "{")
strContent = Replace(strContent, Chr(125), "}")
strContent = Replace(strContent, ">", ">")
strContent = Replace(strContent, "<", "<")
CutString = strContent
End Function
''================================================
''函数名:CheckInfuse
''作 用:防止SQL注入
''参 数:str ----原字符串
'' strLen ----提交字符串长度
''================================================
Public Function CheckInfuse(ByVal str, ByVal strLen)
Dim strUnsafe, arrUnsafe
Dim i

If Trim(str) = "" Then
CheckInfuse = ""
Exit Function
End If
str = Left(str, strLen)

On Error Resume Next
strUnsafe = "''|^|;|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare"
If Trim(str) <> "" Then
If Len(str) > strLen Then
Response.Write "<Script Language=JavaScript>alert(''安全系统提示↓\n\n您提交的字符数超过了限制!'');history.back(-1)</Script>"
CheckInfuse = ""
Response.End
End If
arrUnsafe = Split(strUnsafe, "|")
For i = 0 To UBound(arrUnsafe)
If InStr(1, str, arrUnsafe(i), 1) > 0 Then
Response.Write "<Script Language=JavaScript>alert(''安全系统提示↓\n\n请不要在参数中包含非法字符!'');history.back(-1)</Script>"
CheckInfuse = ""
Response.End
End If
Next
End If
CheckInfuse = Trim(str)
Exit Function
If Err.Number <> 0 Then
Err.Clear
Response.Write "<Script Language=JavaScript>alert(''安全系统提示↓\n\n请不要在参数中包含非法字符!'
  • 上一篇资讯: newasp中下载类
  • 下一篇资讯: 文章列表类别
  • 网学推荐

    免费论文

    原创论文

    浏览:
    设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
    版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
    Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
    湘ICP备09003080号