當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


ASP MoveFile用法及代碼示例

ASP MoveFile方法用於將一個或多個文件從一個位置移動到另一位置。它是FileSystem對象的內置方法。

用法

FileSystemObject.MoveFile source,destination

參數值:

source:這是必填屬性。它包含一個字符串文件,其中可以包含通配符,用於一個或多個要移動的文件。

destination:這也是必填屬性。它指定一個字符串值,將文件移動到何處。它不包含通配符。

例: 下麵的代碼說明了ASP MoveFile方法。

ASP

<% 
dim fs 
set fs=Server.CreateObject("Scripting.FileSystemObject") 
fs.MoveFile "C:\Folder1\A\A.txt","C:\Folder2\B\" 
response.write("The location of the file is changed") 
set fs=nothing 
%>

輸出:

The location of the file is changed

相關用法


注:本文由純淨天空篩選整理自ManasChhabra2大神的英文原創作品 ASP MoveFile Method。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。