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

ubbcode函数

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 13/06/17

鉴于大家对ASP十分关注,我们编辑小组在此为大家搜集整理了“ubbcode函数”一文,供大家参考学习!

复制代码 代码如下:
<%
Public Function UbbCode(strContent)
Dim re
Set re = New RegExp
re.IgnoreCase = True
re.Global = True
''过滤危险脚本
re.Pattern = "(</script>)"
strContent = re.Replace(strContent, "</script>")
re.Pattern = "(script:)"
strContent = re.Replace(strContent, "s cript:")
re.Pattern = "(script)"
strContent = re.Replace(strContent, "s cript")
re.Pattern = "(js:)"
strContent = re.Replace(strContent, "js:")
re.Pattern = "(value)"
strContent = re.Replace(strContent, "value")
re.Pattern = "(about:)"
strContent = re.Replace(strContent, "about:")
re.Pattern = "(file:)"
strContent = re.Replace(strContent, "file:")
re.Pattern = "(document.cookie)"
strContent = re.Replace(strContent, "documents.cookie")
re.Pattern = "(vbs:)"
strContent = re.Replace(strContent, "v bs:")
re.Pattern = "(on(mouse|exit|error|click|key))"
strContent = re.Replace(strContent, "on$2")

re.Pattern = "<IMG.[^>]*SRC(=| )(.[^>]*)>"
''strContent = re.replace(strContent,"<IMG SRC=$2 onclick=""javascript:window.open(this.src);"" style=""CURSOR: pointer"" border=""0"">")
strContent = re.replace(strContent,"<IMG SRC=$2 border=""0"">")

''re.Pattern="<img(.[^>]*)>"
''strContent = re.replace(strContent,"<img$1 onload=""return imgzoom(this,550)"">")

re.Pattern = "(\[i\])(.[^\[]*)(\[\/i\])"
strContent = re.Replace(strContent, "<i>$2</i>")
re.Pattern = "(\[u\])(.[^\[]*)(\[\/u\])"
strContent = re.Replace(strContent, "<u>$2</u>")
re.Pattern = "(\[b\])(.[^\[]*)(\[\/b\])"
strContent = re.Replace(strContent, "<b>$2</b>")
re.Pattern = "(\[fly\])(.*)(\[\/fly\])"
strContent = re.Replace(strContent, "<marquee>$2</marquee>")

re.Pattern = "\[size=([1-9])\](.[^\[]*)\[\/size\]"
strContent = re.Replace(strContent, "<font size=$1>$2</font>")
re.Pattern = "(\[center\])(.[^\[]*)(\[\/center\])"
strContent = re.Replace(strContent, "<center>$2</center>")

re.Pattern = "\[DIR=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/DIR]"
strContent = re.Replace(strContent, "<embed src=$3 pluginspage=http://www.macromedia.com/shockwave/download/ width=$1 height=$2></embed>")
re.Pattern = "\[QT=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/QT]"
strContent = re.Replace(strContent, "<embed src=$3 width=$1 height=$2 autoplay=true loop=false controller=true playeveryframe=false cache=false scale=TOFIT bgcolor=#000000 kioskmode=false targetcache=false pluginspage=http://www.apple.com/quicktime/>")
re.Pattern = "\[MP=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/MP]"
strContent = re.Replace(strContent, "<embed type=applicatio
  • 上一篇资讯: 全面认识ASP注入技巧
  • 下一篇资讯: newasp中下载类
  • 网学推荐

    免费论文

    原创论文

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