次の方法で共有


IsolatedStorageFileStream コンストラクタ (String, FileMode, FileAccess, FileShare, Int32, IsolatedStorageFile)

mode で指定したモード、share で指定したファイル共有モード、buffersize で指定したバッファ サイズ、isf で指定した IsolatedStorageFile のコンテキストを使用して、path で指定したファイルへの、access で指定した種類のアクセスを提供する IsolatedStorageFileStream クラスの新しいインスタンスを初期化します。

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

構文

'宣言
Public Sub New ( _
    path As String, _
    mode As FileMode, _
    access As FileAccess, _
    share As FileShare, _
    bufferSize As Integer, _
    isf As IsolatedStorageFile _
)
'使用
Dim path As String
Dim mode As FileMode
Dim access As FileAccess
Dim share As FileShare
Dim bufferSize As Integer
Dim isf As IsolatedStorageFile

Dim instance As New IsolatedStorageFileStream(path, mode, access, share, bufferSize, isf)
public IsolatedStorageFileStream (
    string path,
    FileMode mode,
    FileAccess access,
    FileShare share,
    int bufferSize,
    IsolatedStorageFile isf
)
public:
IsolatedStorageFileStream (
    String^ path, 
    FileMode mode, 
    FileAccess access, 
    FileShare share, 
    int bufferSize, 
    IsolatedStorageFile^ isf
)
public IsolatedStorageFileStream (
    String path, 
    FileMode mode, 
    FileAccess access, 
    FileShare share, 
    int bufferSize, 
    IsolatedStorageFile isf
)
public function IsolatedStorageFileStream (
    path : String, 
    mode : FileMode, 
    access : FileAccess, 
    share : FileShare, 
    bufferSize : int, 
    isf : IsolatedStorageFile
)

パラメータ

  • path
    分離ストレージ内でのファイルの相対パス。
  • access
    FileAccess 値のビットごとの組み合わせ。
  • share
    FileShare 値のビットごとの組み合わせ。
  • bufferSize
    FileStream のバッファ サイズ。

例外

例外の種類 条件

ArgumentException

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

ArgumentNullException

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

FileNotFoundException

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

IsolatedStorageException

isf はクォータを持っていません。

解説

mode パラメータは、新しいファイルを作成するか、既存のファイルを使用するかを示します。access パラメータには、読み取り専用、読み取り/書き込み可能、および書き込み専用を組み合わせて指定します。

ヒント

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

使用例

このコンストラクタの使用方法については、次のコード例を参照してください。この例のコンテキスト全体については、IsolatedStorageFileStream の概要を参照してください。

' Open or create a writable file with a maximum size of 10K.
Dim isoStream As New IsolatedStorageFileStream(Me.userName, FileMode.OpenOrCreate, _
    FileAccess.Write, FileShare.Write, 10240, isoFile)
// Open or create a writable file with a maximum size of 10K.
IsolatedStorageFileStream isoStream =
    new IsolatedStorageFileStream(this.userName,
    FileMode.OpenOrCreate,
    FileAccess.Write,
    FileShare.Write,
    10240,
    isoFile);
// Open or create a writable file, no larger than 10k
IsolatedStorageFileStream^ isoStream = gcnew IsolatedStorageFileStream( this->userName,FileMode::OpenOrCreate,FileAccess::Write,FileShare::Write,10240,isoFile );

.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 名前空間