佳木斯湛栽影视文化发展公司

主頁 > 知識庫 > asp 中常用的文件處理函數(shù)

asp 中常用的文件處理函數(shù)

熱門標(biāo)簽:電子圍欄 科大訊飛語音識別系統(tǒng) Linux服務(wù)器 阿里云 銀行業(yè)務(wù) 團(tuán)購網(wǎng)站 服務(wù)器配置 Mysql連接數(shù)設(shè)置
asp 中處理文件上傳以及刪除時常用的自定義函數(shù)

%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'所有自定義的VBS函數(shù)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
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) '建立目錄的程序,如果有多級目錄,則一級一級的創(chuàng)建
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) '根據(jù)原文件名生成新的隨機文件名
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_monthc_dayc_hourc_minutec_second"_"ranNum"."fileExt
end function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function jaron_replacer(strContent,start_string,end_string,replace_string)
'CMS替換函數(shù):源字符串,前部分,后部分,替換成的字符
'返回被替換后的字符串
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)
'文檔中,將所有開始,結(jié)束之間的所有字符刪除
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
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
%>

您可能感興趣的文章:
  • ASP.NET MVC處理文件上傳的小例子
  • asp.net 文件上傳實例匯總
  • asp.net文件上傳示例分享
  • ASP.NET讓FileUpload控件支持瀏覽自動上傳功能的解決方法
  • asp.net fileupload控件上傳文件與多文件上傳
  • asp.net FileUpload控件實現(xiàn)文件格式判斷與文件大小限制
  • ASP.NET實現(xiàn)的簡單易用文件上傳類
  • ASP.NET對大文件上傳的解決方案
  • asp.net批量多選文件上傳解決方案
  • ASP.NET設(shè)計FTP文件上傳的解決方案
  • asp.net文件上傳帶進(jìn)度條實現(xiàn)案例(多種風(fēng)格)
  • asp.net文件上傳解決方案(圖片上傳、單文件上傳、多文件上傳、檢查文件類型)
  • ASP.NET MVC5實現(xiàn)文件上傳與地址變化處理(5)
  • ASP.NET文件處理如何操作

標(biāo)簽:蚌埠 江蘇 廣元 萍鄉(xiāng) 棗莊 大理 衡水 衢州

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《asp 中常用的文件處理函數(shù)》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266
    夏河县| 呼图壁县| 达拉特旗| 察雅县| 运城市| 越西县| 永城市| 上犹县| 长宁区| 防城港市| 泾川县| 眉山市| 西宁市| 宽城| 肥西县| 平舆县| 张家口市| 永兴县| 五常市| 玛纳斯县| 临高县| 舒兰市| 义马市| 保靖县| 闵行区| 井研县| 额济纳旗| 石首市| 玉溪市| 石狮市| 临猗县| 武胜县| 新绛县| 婺源县| 双鸭山市| 商南县| 永清县| 宁强县| 黑龙江省| 东阳市| 汤阴县|