複製代碼代碼如下:
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