Share via


IsolatedStorageFile.MoveFile(String, String) 方法

定義

移動指定的檔案至新的位置,並選擇性地讓您指定新檔名。

public:
 void MoveFile(System::String ^ sourceFileName, System::String ^ destinationFileName);
public void MoveFile (string sourceFileName, string destinationFileName);
[System.Runtime.InteropServices.ComVisible(false)]
public void MoveFile (string sourceFileName, string destinationFileName);
member this.MoveFile : string * string -> unit
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.MoveFile : string * string -> unit
Public Sub MoveFile (sourceFileName As String, destinationFileName As String)

參數

sourceFileName
String

要移動的檔案名稱。

destinationFileName
String

檔案的新位置的路徑。 如果包含檔名,已移動的檔案會具有該名稱。

屬性

例外狀況

sourceFileNamedestinationFileName 為零長度字串、只包含空格或包含 GetInvalidPathChars() 方法所定義的一或多個無效字元。

sourceFileNamedestinationFileNamenull

已關閉隔離儲存區。

已處置隔離儲存區。

找不到 sourceFileName

已移除隔離儲存區。

-或-

隔離儲存區已停用。

備註

如果 sourceFileNamedestinationFileName 相同,這個方法不會擲回例外狀況。

適用於

另請參閱