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

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

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 13/06/16
ATH)) then
fso.deletefolder(server.mappath(sPATH))
end if
set fso = nothing
end function

function delnewsfile(sPATH,filename)
on error resume next
dim fso,tempArr,cPATH,ePATH,i:i = 0
set fso = server.createobject("scripting.filesystemobject")
sPATH = sPATH & filename & site_extname
if fso.fileexists(server.mappath(sPATH)) then
fso.deletefile(server.mappath(sPATH))
while(i <> -1)
i = i + 1
ePATH = replace(sPATH,filename & ".",filename & "_" & i + 1 & ".")
if fso.fileexists(server.mappath(ePATH)) then
fso.deletefile(server.mappath(ePATH))
else
i = -1
end if
wend
end if
end function

class stringclass
public function getstr(strhtml)
dim PatrnStr
PatrnStr="<.*?>"
dim objRegEx
set objRegEx = new RegExp
objRegEx.pattern = PatrnStr
objRegEx.ignorecase = true
objRegEx.global = true
getstr = objRegEx.replace(strhtml,"")
set objRegEx = nothing
end function
public function replacestr(patrn,mstr,replstr)
dim objRegEx
set objRegEx = new RegExp
objRegEx.pattern = patrn
objRegEx.ignorecase = true
objRegEx.global = true
replacestr = objRegEx.replace(mstr,replstr)
set objRegEx = nothing
end function
public function classcustomtag(byval patrn,byval mstr,byval classid,byval indexid,byval pagestr)
dim objRegEx,match,matches
set objRegEx = new RegExp
objRegEx.pattern = patrn
objRegEx.ignorecase = true
objRegEx.global = true
set matches = objRegEx.execute(mstr)
for each match in matches
mstr = replace(mstr,match.value,parseclasstag(match.value,classid,indexid,pagestr))
next
set matches = nothing
set objRegEx = nothing
classcustomtag = mstr
end function
public function newscustomtag(byval patrn,byval mstr,byval classid,byval newsid,byval keywords)
dim objRegEx,match,matches
set objRegEx = new RegExp
objRegEx.pattern = patrn
objRegEx.ignorecase = true
objRegEx.global = true
set matches = objRegEx.execute(mstr)
for each match in matches
mstr = replace(mstr,match.value,parsenewstag(match.value,classid,newsid,keywords))
next
set matches = nothing
set objRegEx = nothing
newscustomtag = mstr
end function
end class

function processcustomtag(byval scontent)
dim objRegEx,match,matches
set objRegEx = new RegExp
objRegEx.pattern = "{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 = nothin

网学推荐

免费论文

原创论文

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