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

newasp中main类

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 13/06/17
=============================================================
''函数作用:判断来源URL是否来自外部
''=============================================================
Public Function CheckOuterUrl()
On Error Resume Next
Dim server_v1, server_v2
server_v1 = Replace(LCase(Trim(Request.ServerVariables("HTTP_REFERER"))), "http://", "")
server_v2 = LCase(Trim(Request.ServerVariables("SERVER_NAME")))
If server_v1 <> "" And Left(server_v1, Len(server_v2)) <> server_v2 Then
CheckOuterUrl = False
Else
CheckOuterUrl = True
End If
End Function
''================================================
''函数名:GotTopic
''作 用:显示字符串长度
''参 数:str ----原字符串
'' strlen ----显示字符长度
''================================================
Public Function GotTopic(ByVal str, ByVal strLen)
Dim l, t, c, i
Dim strTemp
On Error Resume Next
str = Trim(str)
str = Replace(str, " ", " ")
str = Replace(str, ">", ">")
str = Replace(str, "<", "<")
str = Replace(str, ">", ">")
str = Replace(str, "<", "<")
str = Replace(str, "'", "''")
str = Replace(str, """, Chr(34))
str = Replace(str, vbNewLine, "")
l = Len(str)
t = 0
For i = 1 To l
c = Abs(Asc(Mid(str, i, 1)))
If c > 255 Then
t = t + 2
Else
t = t + 1
End If
If t >= strLen Then
strTemp = Left(str, i) & "..."
Exit For
Else
strTemp = str & " "
End If
Next
GotTopic = CheckTopic(strTemp)
End Function
Public Function CheckTopic(ByVal strContent)
Dim re
On Error Resume Next
Set re = New RegExp
re.IgnoreCase = True
re.Global = True
re.Pattern = "(<s+cript(.+?)<\/s+cript>)"
strContent = re.Replace(strContent, "")
re.Pattern = "(<iframe(.+?)<\/iframe>)"
strContent = re.Replace(strContent, "")
re.Pattern = "(>)"
strContent = re.Replace(strContent, ">")
re.Pattern = "(<)"
strContent = re.Replace(strContent, "<")
Set re = Nothing
strContent = Replace(strContent, ">", ">")
strContent = Replace(strContent, "<", "<")
strContent = Replace(strContent, "''", "'")
strContent = Replace(strContent, Chr(34), """)
strContent = Replace(strContent, "%", "%")
strContent = Replace(strContent, vbNewLine, "")
CheckTopic = Trim(strContent)
End Function
''================================================
''函数名:ReadTopic
''作 用:显示字符串长度
''参 数:str ----原字符串
'' strlen ----显示字符长度
''==========
  • 上一篇资讯: newasp中下载类
  • 下一篇资讯: 文章列表类别
  • 网学推荐

    免费论文

    原创论文

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