Share via


IsolatedStorageFile.OpenFile 方法

定義

使用指定的共用和存取選項來開啟檔案。

多載

OpenFile(String, FileMode)

使用指定模式來開啟檔案。

OpenFile(String, FileMode, FileAccess)

使用指定的讀取/寫入存取,並以指定模式來開啟檔案。

OpenFile(String, FileMode, FileAccess, FileShare)

使用指定的讀取/寫入存取和共用使用權限,並以指定模式來開啟檔案。

OpenFile(String, FileMode)

來源:
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 的格式不正確。

pathnull

path 中的目錄不存在。

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

已處置隔離儲存區。

備註

這個方法相當於使用 建 IsolatedStorageFileStream.IsolatedStorageFileStream(String, FileMode, IsolatedStorageFile) 構函式。

另請參閱

適用於

OpenFile(String, FileMode, FileAccess)

來源:
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 的格式不正確。

pathnull

path 中的目錄不存在。

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

已處置隔離儲存區。

備註

這個方法相當於使用 建 IsolatedStorageFileStream.IsolatedStorageFileStream(String, FileMode, FileAccess, IsolatedStorageFile) 構函式。

另請參閱

適用於

OpenFile(String, FileMode, FileAccess, FileShare)

來源:
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 的格式不正確。

pathnull

path 中的目錄不存在。

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

已處置隔離儲存區。

備註

這個方法相當於使用 建 IsolatedStorageFileStream.IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare, IsolatedStorageFile) 構函式。

另請參閱

適用於