栏目导航
热点推荐
- ASP下批量删除数据的两种方法
- 关于二级域名共享cookies
- ASP错误代码大全
- ASP代码实现show.asp?id=26变成s
- ASP错误信息解决:IIS启用父路径
- 一些常用的正则表达式大全
- ASP超级链接和HTML函数正则表达
- ASP隐藏下载地址及防盗代码
- 最常用的正则表达式示例
- ASP程序数据库被挂马的处理方法
- ASP生成html的新方法
- 精通ASP错误提示大全
阅览排行
asp中常用的文件处理函数
www.jz123.cn 2008-10-23 来源: 中国建站 编辑整理 我要投递新闻
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
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' SaveRandFileName=replace(replace(replace(now,":",""),"-","")," ","")&int(10*rnd)&"."&fileExt function jaron_replacer(strContent,start_string,end_string,replace_string) |
上一篇:ASP中将Excel数据导入到Access 下一篇:ASP编写计数器的优化方法