当前位置:首页 > ASP教程 > FSO专栏

asp中FSO复制文件代码

复制代码 代码如下:

tempsource,tempend必须用绝对路径
rootpath=request.servervariables("appl_physical_path")  ‘获取当前程序绝对路径
function copyfiles(tempsource,tempend)
    dim fso
    set fso = server.createobject("scripting.filesystemobject")
if fso.fileexists(tempend) then
       response.write "目标备份文件 <b>" & tempend & "</b> 已存在,请先删除!"
       set fso=nothing
       exit function
    end if
    if fso.fileexists(tempsource) then
    else
       response.write "要复制的源数据库文件 <b>"&tempsource&"</b> 不存在!"
       set fso=nothing
       exit function
    end if
    fso.copyfile tempsource,tempend
    response.write "已经成功复制文件 <b>"&tempsource&"</b> 到 <b>"&tempend&"</b>"
    set fso = nothing
end function


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!