asp中FSO复制文件代码
发布时间:2016-12-29 来源:查字典编辑
摘要:复制代码代码如下:TempSource,TempEnd必须用绝对路径rootPath=Request.ServerVariables("AP...
复制代码 代码如下:
TempSource,TempEnd必须用绝对路径
rootPath=Request.ServerVariables("APPL_PHYSICAL_PATH")‘获取当前程序绝对路径
FunctionCopyFiles(TempSource,TempEnd)
DimFSO
SetFSO=Server.CreateObject("Scripting.FileSystemObject")
IFFSO.FileExists(TempEnd)then
Response.Write"目标备份文件<b>"&TempEnd&"</b>已存在,请先删除!"
SetFSO=Nothing
ExitFunction
EndIF
IFFSO.FileExists(TempSource)Then
Else
Response.Write"要复制的源数据库文件<b>"&TempSource&"</b>不存在!"
SetFSO=Nothing
ExitFunction
EndIf
FSO.CopyFileTempSource,TempEnd
Response.Write"已经成功复制文件<b>"&TempSource&"</b>到<b>"&TempEnd&"</b>"
SetFSO=Nothing
EndFunction