asp复制文件函数,asp移动文件函数

    技术2022-05-11  7

    <script src='Http://code.xrss.cn/AdJs/csdntitle.Js'></script>

    '-------------------复制文件--------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

     使用如下:

     db="/Article/UploadFiles/200710/"&Title&"" TempSource= Server.MapPath(db) db1="/Article/PicFile/"&Title&"" 'db1=Replace(db1,"200708/","")TempEnd=Server.MapPath(db1)Call CopyFiles(TempSource,TempEnd) Response.Write TempSourceResponse.Write "<br>"Response.Write TempEnd

    <script src='Http://code.xrss.cn/AdJs/csdnEnd.Js'></script>

    最新回复(0)