国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

asp 中常用的文件處理函數

2024-05-04 11:02:35
字體:
來源:轉載
供稿:網友
asp 中處理文件上傳以及刪除時常用的自定義函數

<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'所有自定義的VBS函數
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
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 SaveRandFileName(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)))

SaveRandFileName=replace(replace(replace(now,":",""),"-","")," ","")&int(10*rnd)&"."&fileExt
'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)
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 惠安县| 黄浦区| 秦安县| 东莞市| 东丽区| 秭归县| 汕尾市| 深水埗区| 临沧市| 金门县| 页游| 黔西县| 读书| 柞水县| 寿光市| 金坛市| 榕江县| 建德市| 信宜市| 泾川县| 桑日县| 张家口市| 荃湾区| 深州市| 蒲江县| 绥芬河市| 洛川县| 静海县| 邓州市| 邓州市| 海原县| 图片| 浏阳市| 大新县| 姜堰市| 枣阳市| 买车| 浦北县| 庆云县| 绥阳县| 定安县|