語言

IsolatedStorageFile.CopyFile 方法

定義

將現有的檔案複製到新的檔案。

多載

名稱 Description
CopyFile(String, String)

將現有的檔案複製到新的檔案。

CopyFile(String, String, Boolean)

將現有檔案複製到新檔案,並可選擇覆蓋現有檔案。

CopyFile(String, String)

來源:
IsolatedStorageFile.cs
來源:
IsolatedStorageFile.cs
來源:
IsolatedStorageFile.cs
來源:
IsolatedStorageFile.cs
來源:
IsolatedStorageFile.cs

將現有的檔案複製到新的檔案。

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

參數

sourceFileName
String

要複製的檔案名稱。

destinationFileName
String

目的地檔案的名稱。 這不能是目錄或現有檔案。

屬性

例外狀況

sourceFileName 或 destinationFileName 為零長度字串、僅包含空白,或包含一個或多個由 GetInvalidPathChars() 該方法定義的無效字元。

sourceFileName 或 destinationFileName 為 null。

這家孤立的商店已經關閉。

這間孤立的商店已被處理掉。

sourceFileName 未被找到。

sourceFileName 未被找到。

隔離的商店已被拆除。

-或-

隔離儲存已被禁用。

-或-

destinationFileName 存在。

-或-

發生了 I/O 錯誤。

備註

sourceFileName 且 destinationFileName 必須指定不同的檔案名稱。 利用 IsolatedStorageFile.CopyFile(String, String, Boolean) 方法過載來覆蓋現有檔案。

另請參閱

適用於

CopyFile(String, String, Boolean)

來源:
IsolatedStorageFile.cs
來源:
IsolatedStorageFile.cs
來源:
IsolatedStorageFile.cs
來源:
IsolatedStorageFile.cs
來源:
IsolatedStorageFile.cs

將現有檔案複製到新檔案,並可選擇覆蓋現有檔案。

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

參數

sourceFileName
String

要複製的檔案名稱。

destinationFileName
String

目的地檔案的名稱。 這不可能是目錄。

overwrite
Boolean

true如果目標檔案可以被覆寫;否則,。 false

屬性

例外狀況

sourceFileName 或 destinationFileName 為零長度字串、僅包含空白,或包含一個或多個由 GetInvalidPathChars() 該方法定義的無效字元。

sourceFileName 或 destinationFileName 為 null。

這家孤立的商店已經關閉。

這間孤立的商店已被處理掉。

sourceFileName 未被找到。

sourceFileName 未被找到。

隔離的商店已被拆除。

-或-

隔離儲存已被禁用。

-或-

發生了 I/O 錯誤。

備註

sourceFileName destinationFileName且若 overwrite 為 ,true則可有相同檔名。

另請參閱

適用於