忠网广告 系统 用到的几个函数(3)
'********************************************************************//
Function PubDeleteFile(Filename) '删除文件
Dim fso
if Filename<>"" then
Filename=Server.MapPath(Filename)
Set fso = server.CreateObject("Scripting.FileSystemObject")
if fso.FileExists(Filename) then
fso.DeleteFile Filename
PubDeleteFile="Suc"
end if
set fso = nothing
end if
end Function
'//********************************************************************
' PubDeleteFolder(Foldername) 删除目录,需要 fso支持 参数:Foldername 预删除目录的相对路径
'********************************************************************//
Function PubDeleteFolder(Foldername) '删除目录
Dim fso
if Foldername<>"" then
Foldername=Server.MapPath(Foldername)
Set fso = server.CreateObject("Scripting.FileSystemObject")
if fso.FolderExists(Foldername) then
fso.DeleteFolder Foldername
PubDeleteFolder="Suc"
end if
set fso = nothing
end if
end Function
'//********************************************************************
' PubCopyFile(Filename,Filenewname) 拷贝文件,需要 fso支持 参数:Filename 预拷贝文件的相对路径,Filenewname 拷贝目标名
'********************************************************************//
Function PubCopyFile(Filename,Filenewname)
Dim fso,f
if Filename<>"" and Filenewname<>"" then
Filename=Server.MapPath(Filename)
Filenewname=Server.MapPath(Filenewname)
Set fso = server.CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(Filename)
f.Copy Filenewname,true
set fso = nothing
set f = nothing
PubCopyFile="Suc"
end if
End Function
'//********************************************************************
' PubSetFolder(Foldername) 新建目录,需要 fso支持 参数:Foldername 目录名称
'********************************************************************//
Function PubSetFolder(Foldername)
Dim fso
if Foldername<>"" then
Foldername=Server.MapPath(Foldername)
Set fso = server.CreateObject("Scripting.FileSystemObject")
内容版权声明:除非注明,否则皆为本站原创文章。