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
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器