复制代码 代码如下: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
推荐阅读
ASP编程入门进阶(十八):FSO组件之文件操作(下)
一,fso.GetFile提取文件相应的 File 对象1,getfile.asp
<%whichfile=Server.MapPath("cnbruce.txt")Set fso = CreateObject("Scripting.FileSystemObject")Set f1 = fso.CreateTextFile(whichfile,true)f1.Wr>>>详细阅读
本文标题:asp中FSO复制文件代码
地址:http://www.17bianji.com/kaifa2/ASP/32855.html
1/2 1