语言

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

文件的新位置的路径。 如果包含文件名,则移动的文件将具有该名称。

特性

例外

sourceFileName 或 destinationFileName 为零长度字符串,仅包含空格,或包含方法定义的 GetInvalidPathChars() 一个或多个无效字符。

sourceFileName 或 destinationFileName 为 null.

隔离存储已关闭。

已释放隔离存储。

sourceFileName 找不到。

已删除独立存储区。

-或-

已禁用独立存储。

注解

如果sourceFileNamedestinationFileName和相同,此方法不会引发异常。

适用于

另请参阅