|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
只要你想学,就没什么优缺点,上面那位大哥已经把网上的评论说了,但我认为想学哪个都一样,不然它就不可能在当今时代数字艺术方面存活到今天 function DeleteFile(Filename) '删除文件
if Filename<>"" then
Set fso = server.CreateObject("Scripting.FileSystemObject")
if fso.FileExists(Filename) then
fso.DeleteFile Filename
end if
set fso = nothing
end if
end function
function CreateDIR(byval LocalPath) '创立目次的法式,假如有多级目次,则一级一级的创立
on error resume next
LocalPath = replace(LocalPath,"\","/")
set FileObject = server.createobject("Scripting.FileSystemObject")
patharr = split(LocalPath,"/")
path_level = ubound(patharr)
for i = 0 to path_level
if i=0 then pathtmp=patharr(0) & "/" else pathtmp = pathtmp & patharr(i) & "/"
cpath = left(pathtmp,len(pathtmp)-1)
if not FileObject.FolderExists(cpath) then FileObject.CreateFolder cpath
next
set FileObject = nothing
if err.number<>0 then
CreateDIR = false
err.Clear
else
CreateDIR = true
end if
end function
function GenerateRandomFileName(byval szFilename) '依据原文件名生成新的随机文件名
randomize
ranNum=int(90000*rnd)+10000
if month(now)<10 then c_month="0" & month(now) else c_month=month(now)
if day(now)<10 then c_day="0" & day(now) else c_day=day(now)
if hour(now)<10 then c_hour="0" & hour(now) else c_hour=hour(now)
if minute(now)<10 then c_minute="0" & minute(now) else c_minute=minute(now)
if second(now)<10 then c_second="0" & second(now) else c_second=minute(now)
fileExt_a=split(szFilename,".")
fileExt=lcase(fileExt_a(ubound(fileExt_a)))
GenerateRandomFileName = year(now)&c_month&c_day&c_hour&c_minute&c_second&"_"&ranNum&"."&fileExt
end function
function jaron_replacer(strContent,start_string,end_string,replace_string)
'CMS交换函数:源字符串,前局部,后局部,交换成的字符
'前往被交换后的字符串
jaron_replacer = replace(strContent,mid(strContent,instr(strContent,start_string),instr(strContent,end_string)+len(end_string)-1),replace_string)
end function
function replaceplus(strContent,start_string,end_string,replace_string) '文档中,将一切入手下手,停止之间的一切字符删除
on error resume next
MARKCOUNTS = ubound(split(strContent,start_string))
PRESTRING = strContent
for i=0 to MARKCOUNTS
STARTMARK=instr(1,PRESTRING,start_string,1)
if STARTMARK=0 then exit for
COMPMARK=instr(1,PRESTRING,end_string,1) + len(end_string)
VerString=mid(PRESTRING,STARTMARK,COMPMARK - STARTMARK)
PRESTRING = replace(PRESTRING,VerString,replace_string)
next
replaceplus = PRESTRING
if err.number<>0 then err.Clear
end function
假如在一段HTML中,你其实不晓得外面有几何个Flash,想把他们全体删除。就能够如许用。
strContent = replaceplus(strContent,"<OBJECT","</OBJECT>","")
这个号令可以把HTML代码中一切<object> .... </object>的标志全体删除。
ASP脚本是采用明文(plain text)方式来编写的。 |
|