語言

IsolatedStorageFile.OpenFile 方法

定義

透過指定的分享與存取選項開啟檔案。

多載

名稱 Description
OpenFile(String, FileMode)

以指定的模式開啟檔案。

OpenFile(String, FileMode, FileAccess)

以指定模式以指定的讀寫權限開啟檔案。

OpenFile(String, FileMode, FileAccess, FileShare)

以指定模式開啟檔案,擁有指定的讀寫權限與分享權限。

OpenFile(String, FileMode)

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

以指定的模式開啟檔案。

public:
 System::IO::IsolatedStorage::IsolatedStorageFileStream ^ OpenFile(System::String ^ path, System::IO::FileMode mode);
public System.IO.IsolatedStorage.IsolatedStorageFileStream OpenFile(string path, System.IO.FileMode mode);
[System.Runtime.InteropServices.ComVisible(false)]
public System.IO.IsolatedStorage.IsolatedStorageFileStream OpenFile(string path, System.IO.FileMode mode);
member this.OpenFile : string * System.IO.FileMode -> System.IO.IsolatedStorage.IsolatedStorageFileStream
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.OpenFile : string * System.IO.FileMode -> System.IO.IsolatedStorage.IsolatedStorageFileStream
Public Function OpenFile (path As String, mode As FileMode) As IsolatedStorageFileStream

參數

path
String

檔案在孤立儲存庫中的相對路徑。

mode
FileMode

其中一個列舉值,用來指定如何開啟檔案。

傳回

以指定模式開啟、具備讀寫權限且未共享的檔案。

屬性

例外狀況

隔離的商店已被拆除。

-或-

隔離儲存已被禁用。

path 畸形。

path 是 null。

目錄 path 不存在。

找不到任何檔案,且設定 mode 為 Open。

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

備註

此方法等同於使用建 IsolatedStorageFileStream.IsolatedStorageFileStream(String, FileMode, IsolatedStorageFile) 構子。

另請參閱

適用於

OpenFile(String, FileMode, FileAccess)

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

以指定模式以指定的讀寫權限開啟檔案。

public:
 System::IO::IsolatedStorage::IsolatedStorageFileStream ^ OpenFile(System::String ^ path, System::IO::FileMode mode, System::IO::FileAccess access);
public System.IO.IsolatedStorage.IsolatedStorageFileStream OpenFile(string path, System.IO.FileMode mode, System.IO.FileAccess access);
[System.Runtime.InteropServices.ComVisible(false)]
public System.IO.IsolatedStorage.IsolatedStorageFileStream OpenFile(string path, System.IO.FileMode mode, System.IO.FileAccess access);
member this.OpenFile : string * System.IO.FileMode * System.IO.FileAccess -> System.IO.IsolatedStorage.IsolatedStorageFileStream
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.OpenFile : string * System.IO.FileMode * System.IO.FileAccess -> System.IO.IsolatedStorage.IsolatedStorageFileStream
Public Function OpenFile (path As String, mode As FileMode, access As FileAccess) As IsolatedStorageFileStream

參數

path
String

檔案在孤立儲存庫中的相對路徑。

mode
FileMode

其中一個列舉值,用來指定如何開啟檔案。

access
FileAccess

其中一個列舉值,用來指定檔案是否以讀取、寫入或讀寫存取開啟。

傳回

一個以指定模式和存取方式開啟且未共享的檔案。

屬性

例外狀況

隔離的商店已被拆除。

-或-

隔離儲存已被禁用。

path 畸形。

path 是 null。

目錄 path 不存在。

找不到任何檔案,且設定 mode 為 Open。

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

備註

此方法等同於使用建 IsolatedStorageFileStream.IsolatedStorageFileStream(String, FileMode, FileAccess, IsolatedStorageFile) 構子。

另請參閱

適用於

OpenFile(String, FileMode, FileAccess, FileShare)

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

以指定模式開啟檔案,擁有指定的讀寫權限與分享權限。

public:
 System::IO::IsolatedStorage::IsolatedStorageFileStream ^ OpenFile(System::String ^ path, System::IO::FileMode mode, System::IO::FileAccess access, System::IO::FileShare share);
public System.IO.IsolatedStorage.IsolatedStorageFileStream OpenFile(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share);
[System.Runtime.InteropServices.ComVisible(false)]
public System.IO.IsolatedStorage.IsolatedStorageFileStream OpenFile(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share);
member this.OpenFile : string * System.IO.FileMode * System.IO.FileAccess * System.IO.FileShare -> System.IO.IsolatedStorage.IsolatedStorageFileStream
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.OpenFile : string * System.IO.FileMode * System.IO.FileAccess * System.IO.FileShare -> System.IO.IsolatedStorage.IsolatedStorageFileStream
Public Function OpenFile (path As String, mode As FileMode, access As FileAccess, share As FileShare) As IsolatedStorageFileStream

參數

path
String

檔案在孤立儲存庫中的相對路徑。

mode
FileMode

其中一個列舉值,用來指定如何開啟或建立檔案。

access
FileAccess

其中一個列舉值,用來指定檔案是否以讀取、寫入或讀寫存取開啟。

share
FileShare

一個位元組合的列舉值,指定其他 IsolatedStorageFileStream 物件對此檔案的存取類型。

傳回

一個以指定模式與存取方式開啟,並具備特定分享選項的檔案。

屬性

例外狀況

隔離的商店已被拆除。

-或-

隔離儲存已被禁用。

path 畸形。

path 是 null。

目錄 path 不存在。

找不到任何檔案,且設定 mode 為 Open(FileMode)。

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

備註

此方法等同於使用建 IsolatedStorageFileStream.IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare, IsolatedStorageFile) 構子。

另請參閱

適用於