次の方法で共有


IsolatedStorageFileStream コンストラクタ (String, FileMode)

指定した mode で、path によって指定されたファイルへのアクセスを与える IsolatedStorageFileStream オブジェクトの新しいインスタンスを初期化します。

名前空間: System.IO.IsolatedStorage
アセンブリ: mscorlib (mscorlib.dll 内)

構文

'宣言
Public Sub New ( _
    path As String, _
    mode As FileMode _
)
'使用
Dim path As String
Dim mode As FileMode

Dim instance As New IsolatedStorageFileStream(path, mode)
public IsolatedStorageFileStream (
    string path,
    FileMode mode
)
public:
IsolatedStorageFileStream (
    String^ path, 
    FileMode mode
)
public IsolatedStorageFileStream (
    String path, 
    FileMode mode
)
public function IsolatedStorageFileStream (
    path : String, 
    mode : FileMode
)

パラメータ

  • path
    分離ストレージ内でのファイルの相対パス。

例外

例外の種類 条件

ArgumentException

path の形式が正しくありません。

ArgumentNullException

path が null 参照 (Visual Basic では Nothing) です。

DirectoryNotFoundException

path 内にディレクトリが存在しません。

FileNotFoundException

mode に Open が設定されていますが、ファイルが見つかりません。

解説

使用する分離ストアのスコープは、現在実行されているアセンブリの ID と、このアセンブリを実行しているアプリケーション ドメインの ID によって指定されます。このストアは、IsolatedStorageFileStream オブジェクトの有効期間の間だけ開かれたままになります。別の分離ストレージ スコープを指定するか、ストアを開いたままにすることで、複数の IsolatedStorageFileStream オブジェクトを開くことができるようにする場合は、IsolatedStorageFile オブジェクトを扱える形式のコンストラクタを使用します。

mode パラメータは、新しいファイルを作成するか、既存のファイルを使用するかなどを示します。

ヒント

特定のカルチャ設定で文字セットをコンパイルし、同じ文字を異なるカルチャ設定で取得すると、文字が解釈されないことがあります。さらに、例外がスローされることもあります。

.NET Framework のセキュリティ

プラットフォーム

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 2.0、1.1、1.0

参照

関連項目

IsolatedStorageFileStream クラス
IsolatedStorageFileStream メンバ
System.IO.IsolatedStorage 名前空間