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

asp常用函数集合,非常不错以后研究第1/4页

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 13/06/16
g
set objRegEx = nothing
processcustomtag = scontent
end function

function X_processcustomtag(byval scontent)
dim objRegEx,match,matches
set objRegEx = new RegExp
objRegEx.pattern = "(\[ncms:).+?(\])(.|\n)+?(\[\/ncms\])"
objRegEx.ignorecase = true
objRegEx.global = true
set matches = objRegEx.execute(scontent)
for each match in matches
scontent = replace(scontent,match.value,parsetag(match.value))
next
set matches = nothing
set objRegEx = nothing
X_processcustomtag = scontent
end function

function getattribute(byval strattribute,byval strtag)
dim objRegEx,matches
set objRegEx = new RegExp
objRegEx.pattern = lcase(strattribute)&"=""[0-9a-zA-Z]*"""
objRegEx.ignorecase = true
objRegEx.global = true
set matches = objRegEx.execute(strtag)
if matches.count > 0 then
getattribute = split(matches(0).value,"""")(1)
else
getattribute = ""
end if
set matches = nothing
set objRegEx = nothing
end function

function getinnerhtml(byval strhtml)
dim objregex,matches,str
set objregex = new regexp
objregex.pattern = "(\])(.|\n)+?(\[\/ncms\])"
objregex.ignorecase = true
objregex.global = false
set matches = objregex.execute(strhtml)
if matches.count > 0 then
str = trim(matches.item(0).value)
end if
set matches = nothing
if len(str) > 8 then
getinnerhtml = mid(str,2,len(str) - 8)
end if
end function

function parsetag(byval strtag)
dim arrresult,classname,arrattributes,objclass
if len(strtag) = 0 then exit function
arrresult = split(strtag,":")
classname = split(arrresult(1)," ")(0)
select case lcase(classname)
case "news"
set objclass = new ncmsnewstag
if not isnumeric(getattribute("id",strtag)) then
response.write("标签[ncms:news]参数错误!参数[id]必须是数字!")
response.end()
end if
objclass.id = getattribute("id",strtag)
if not isnumeric(getattribute("num",strtag)) then
response.write("标签[ncms:news]参数错误!参数[num]必须是数字!")
response.end()
end if
objclass.num = getattribute("num",strtag)
if not isnumeric(getattribute("len",strtag)) then
response.write("标签[ncms:news]参数错误!参数[len]必须是数字!")
response.end()
end if
objclass.len = getattribute("len",strtag)
objclass.show = getattribute("show",strtag)
if getattribute("lih",strtag) <> "" and not isnumeric(getattribute("lih",strtag)) then
response.write("标签[ncms:news]参数错误!参数[lih]必须是数字!")
response.end()
end if
objclass.lih = getattribute("lih",strtag)
if

网学推荐

免费论文

原创论文

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