IsolatedStorageFileStream Konstruktory

Definice

Inicializuje novou instanci IsolatedStorageFileStream třídy . Jediný způsob, jak otevřít, IsolatedStorageFileStream je použít jeden z jeho konstruktorů.

Přetížení

IsolatedStorageFileStream(String, FileMode)

Inicializuje novou instanci objektu, který IsolatedStorageFileStream poskytuje přístup k souboru určenému path v zadaném modeobjektu .

IsolatedStorageFileStream(String, FileMode, FileAccess)

Inicializuje novou instanci IsolatedStorageFileStream třídy, která poskytuje přístup k souboru určenému pathv zadaném modeobjektu , s typem požadovaného access typu.

IsolatedStorageFileStream(String, FileMode, IsolatedStorageFile)

Inicializuje novou instanci IsolatedStorageFileStream třídy, která poskytuje přístup k souboru určenému nástrojem path, v zadaném modea v kontextu zadaném IsolatedStorageFile nástrojem isf.

IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare)

Inicializuje novou instanci IsolatedStorageFileStream třídy, která poskytuje přístup k souboru určenému pathv zadaném modesouboru se zadaným souborem accesspomocí režimu sdílení souborů určeného nástrojem share.

IsolatedStorageFileStream(String, FileMode, FileAccess, IsolatedStorageFile)

Inicializuje novou instanci IsolatedStorageFileStream třídy, která poskytuje přístup k souboru určenému path v zadaném modesouboru , se zadaným souborem accessa v kontextu určeném IsolatedStorageFile nástrojem isf.

IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare, Int32)

Inicializuje novou instanci IsolatedStorageFileStream třídy, která poskytuje přístup k souboru určenému pathv zadaném modesouboru se zadaným souborem accesspomocí režimu sdílení souborů určeného nástrojem share, se zadaným buffersize .

IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare, IsolatedStorageFile)

Inicializuje novou instanci IsolatedStorageFileStream třídy, která poskytuje přístup k souboru určenému pathnástrojem , v zadaném modesouboru se zadaným souborem access, pomocí režimu sdílení souborů určeného nástrojem sharea v kontextu určeném IsolatedStorageFile nástrojem isf.

IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare, Int32, IsolatedStorageFile)

Inicializuje novou instanci IsolatedStorageFileStream třídy, která poskytuje přístup k souboru určenému pathv zadaném modesouboru se zadaným souborem accesspomocí režimu sdílení souborů určeného nástrojem share, se zadaným buffersize a v kontextu IsolatedStorageFile určeném nástrojem isf.

IsolatedStorageFileStream(String, FileMode)

Zdroj:
IsolatedStorageFileStream.cs
Zdroj:
IsolatedStorageFileStream.cs
Zdroj:
IsolatedStorageFileStream.cs

Inicializuje novou instanci objektu, který IsolatedStorageFileStream poskytuje přístup k souboru určenému path v zadaném modeobjektu .

public:
 IsolatedStorageFileStream(System::String ^ path, System::IO::FileMode mode);
public IsolatedStorageFileStream (string path, System.IO.FileMode mode);
new System.IO.IsolatedStorage.IsolatedStorageFileStream : string * System.IO.FileMode -> System.IO.IsolatedStorage.IsolatedStorageFileStream
Public Sub New (path As String, mode As FileMode)

Parametry

path
String

Relativní cesta k souboru v izolovaném úložišti.

mode
FileMode

Jedna z FileMode hodnot.

Výjimky

Je path špatně formován.

Hodnota path je null.

Adresář v path souboru neexistuje.

Nebyl nalezen žádný soubor a hodnota je nastavená mode na Open

Poznámky

Izolované úložiště, které se používá, je vymezeno identitou aktuálního spuštěného sestavení a identitou domény aplikace, ve které je spuštěno. Toto úložiště zůstane otevřené pouze po dobu životnosti objektu IsolatedStorageFileStream . Pokud chcete zadat jiný obor izolovaného úložiště nebo povolit, aby úložiště zůstalo otevřené (aby z něj bylo možné otevřít více IsolatedStorageFileStream objektů), použijte formu konstruktoru, který přijímá IsolatedStorageFile objekt.

Parametr mode označuje, jestli se má vytvořit nový soubor, použít existující soubor atd.

Upozornění

Když kompilujete sadu znaků s určitým kulturním nastavením a načtete stejné znaky s jiným kulturním nastavením, nemusí být znaky interpretovatelné a může způsobit vyvolání výjimky.

Platí pro

IsolatedStorageFileStream(String, FileMode, FileAccess)

Zdroj:
IsolatedStorageFileStream.cs
Zdroj:
IsolatedStorageFileStream.cs
Zdroj:
IsolatedStorageFileStream.cs

Inicializuje novou instanci IsolatedStorageFileStream třídy, která poskytuje přístup k souboru určenému pathv zadaném modeobjektu , s typem požadovaného access typu.

public:
 IsolatedStorageFileStream(System::String ^ path, System::IO::FileMode mode, System::IO::FileAccess access);
public IsolatedStorageFileStream (string path, System.IO.FileMode mode, System.IO.FileAccess access);
new System.IO.IsolatedStorage.IsolatedStorageFileStream : string * System.IO.FileMode * System.IO.FileAccess -> System.IO.IsolatedStorage.IsolatedStorageFileStream
Public Sub New (path As String, mode As FileMode, access As FileAccess)

Parametry

path
String

Relativní cesta k souboru v izolovaném úložišti.

mode
FileMode

Jedna z FileMode hodnot.

access
FileAccess

Bitové kombinace FileAccess hodnot.

Výjimky

Je path špatně formován.

Hodnota path je null.

Nebyl nalezen žádný soubor a mode hodnota je nastavená na Open.

Poznámky

Izolované úložiště, které se používá, je vymezeno identitou aktuálního spuštěného sestavení a identitou domény aplikace, ve které je spuštěno. Toto úložiště zůstane otevřené pouze po dobu životnosti objektu IsolatedStorageFileStream . Pokud chcete zadat jiný obor izolovaného úložiště nebo povolit, aby úložiště zůstalo otevřené (aby z něj bylo možné otevřít více IsolatedStorageFileStream objektů), použijte formu konstruktoru, který přijímá IsolatedStorageFile objekt.

Parametr mode označuje, jestli se má vytvořit nový soubor nebo použít existující soubor. Parametr access zahrnuje jen pro čtení, čtení/zápis a jen pro zápis.

Upozornění

Když zkompilujete sadu znaků s určitým kulturním nastavením a načtete stejné znaky s jiným kulturním nastavením, nemusí být znaky interpretovatelné a může způsobit vyvolání výjimky.

Platí pro

IsolatedStorageFileStream(String, FileMode, IsolatedStorageFile)

Zdroj:
IsolatedStorageFileStream.cs
Zdroj:
IsolatedStorageFileStream.cs
Zdroj:
IsolatedStorageFileStream.cs

Inicializuje novou instanci IsolatedStorageFileStream třídy, která poskytuje přístup k souboru určenému nástrojem path, v zadaném modea v kontextu zadaném IsolatedStorageFile nástrojem isf.

public:
 IsolatedStorageFileStream(System::String ^ path, System::IO::FileMode mode, System::IO::IsolatedStorage::IsolatedStorageFile ^ isf);
public IsolatedStorageFileStream (string path, System.IO.FileMode mode, System.IO.IsolatedStorage.IsolatedStorageFile isf);
public IsolatedStorageFileStream (string path, System.IO.FileMode mode, System.IO.IsolatedStorage.IsolatedStorageFile? isf);
new System.IO.IsolatedStorage.IsolatedStorageFileStream : string * System.IO.FileMode * System.IO.IsolatedStorage.IsolatedStorageFile -> System.IO.IsolatedStorage.IsolatedStorageFileStream
Public Sub New (path As String, mode As FileMode, isf As IsolatedStorageFile)

Parametry

path
String

Relativní cesta k souboru v izolovaném úložišti.

mode
FileMode

Jedna z FileMode hodnot.

Výjimky

Je path špatně formován.

Hodnota path je null.

Nebyl nalezen žádný soubor a mode hodnota je nastavená na Open.

isf nemá kvótu.

Příklady

Následující příklad kódu ukazuje použití tohoto konstruktoru. Úplný kontext tohoto příkladu najdete v přehledu IsolatedStorageFileStream .

// This is the stream to which data will be written.
IsolatedStorageFileStream^ source = gcnew IsolatedStorageFileStream( this->userName,FileMode::OpenOrCreate,isoFile );

// This is the stream from which data will be read.
Console::WriteLine( "Is the source file readable?  {0}", (source->CanRead ? (String^)"true" : "false") );
Console::WriteLine( "Creating new IsolatedStorageFileStream for Archive." );

// Open or create a writable file.
IsolatedStorageFileStream^ target = gcnew IsolatedStorageFileStream( String::Concat("Archive\\",this->userName),FileMode::OpenOrCreate,FileAccess::Write,FileShare::Write,isoFile );

IsolatedStorageFileStream source =
    new IsolatedStorageFileStream(this.userName, FileMode.OpenOrCreate,
    isoFile);
// This is the stream from which data will be read.
Console.WriteLine("Is the source file readable? " + (source.CanRead ? "true" : "false"));
Console.WriteLine("Creating new IsolatedStorageFileStream for Archive.");

// Open or create a writable file.
IsolatedStorageFileStream target =
    new IsolatedStorageFileStream("Archive\\ " + this.userName,
    FileMode.OpenOrCreate,
    FileAccess.Write,
    FileShare.Write,
    isoFile);
' Open or create a writable file.
Dim target As New IsolatedStorageFileStream("Archive\ " & Me.userName, _
     FileMode.OpenOrCreate, FileAccess.Write, FileShare.Write, isoFile)

Poznámky

Parametr mode označuje, jestli se má vytvořit nový soubor, použít existující soubor atd.

Upozornění

Když zkompilujete sadu znaků s určitým kulturním nastavením a načtete stejné znaky s jiným kulturním nastavením, nemusí být znaky interpretovatelné a může způsobit vyvolání výjimky.

Platí pro

IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare)

Zdroj:
IsolatedStorageFileStream.cs
Zdroj:
IsolatedStorageFileStream.cs
Zdroj:
IsolatedStorageFileStream.cs

Inicializuje novou instanci IsolatedStorageFileStream třídy, která poskytuje přístup k souboru určenému pathv zadaném modesouboru se zadaným souborem accesspomocí režimu sdílení souborů určeného nástrojem share.

public:
 IsolatedStorageFileStream(System::String ^ path, System::IO::FileMode mode, System::IO::FileAccess access, System::IO::FileShare share);
public IsolatedStorageFileStream (string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share);
new System.IO.IsolatedStorage.IsolatedStorageFileStream : string * System.IO.FileMode * System.IO.FileAccess * System.IO.FileShare -> System.IO.IsolatedStorage.IsolatedStorageFileStream
Public Sub New (path As String, mode As FileMode, access As FileAccess, share As FileShare)

Parametry

path
String

Relativní cesta k souboru v izolovaném úložišti.

mode
FileMode

Jedna z FileMode hodnot.

access
FileAccess

Bitové kombinace FileAccess hodnot.

share
FileShare

Bitové kombinace FileShare hodnot.

Výjimky

Je path špatně formován.

Hodnota path je null.

Nebyl nalezen žádný soubor a mode hodnota je nastavená na Open.

Příklady

Následující příklad kódu ukazuje použití tohoto konstruktoru. Úplný kontext tohoto příkladu najdete v přehledu IsolatedStorageFileStream .

// Retrieve an IsolatedStorageFile for the current Domain and Assembly.
IsolatedStorageFile^ isoFile = IsolatedStorageFile::GetStore( static_cast<IsolatedStorageScope>(IsolatedStorageScope::User | IsolatedStorageScope::Assembly | IsolatedStorageScope::Domain), (Type^)nullptr, nullptr );
IsolatedStorageFileStream^ isoStream = gcnew IsolatedStorageFileStream( this->userName,FileMode::Open,FileAccess::ReadWrite,isoFile );

// Retrieve an IsolatedStorageFile for the current Domain and Assembly.
IsolatedStorageFile isoFile =
    IsolatedStorageFile.GetStore(IsolatedStorageScope.User |
    IsolatedStorageScope.Assembly |
    IsolatedStorageScope.Domain,
    null,
    null);

IsolatedStorageFileStream isoStream =
    new IsolatedStorageFileStream("substituteUsername",
    System.IO.FileMode.Open,
    System.IO.FileAccess.Read,
     System.IO.FileShare.Read);
' Retrieve an IsolatedStorageFile for the current Domain and Assembly.
Dim isoFile As IsolatedStorageFile = _
    IsolatedStorageFile.GetStore(IsolatedStorageScope.User _
    Or IsolatedStorageScope.Assembly _
    Or IsolatedStorageScope.Domain, Nothing, Nothing)

Dim isoStream As New IsolatedStorageFileStream("substituteUsername", System.IO.FileMode.Open, _
    System.IO.FileAccess.Read, System.IO.FileShare.Read)

Poznámky

Izolované úložiště, které se používá, je vymezeno identitou aktuálního spuštěného sestavení a identitou domény aplikace, ve které je spuštěno. Toto úložiště zůstane otevřené pouze po dobu životnosti objektu IsolatedStorageFileStream . Pokud chcete zadat jiný obor izolovaného úložiště nebo povolit, aby úložiště zůstalo otevřené (aby z něj bylo možné otevřít více IsolatedStorageFileStream objektů), použijte formu konstruktoru, který přijímá IsolatedStorageFile objekt.

Upozornění

Když kompilujete sadu znaků s určitým kulturním nastavením a načtete stejné znaky s jiným kulturním nastavením, nemusí být znaky interpretovatelné a může způsobit vyvolání výjimky.

Platí pro

IsolatedStorageFileStream(String, FileMode, FileAccess, IsolatedStorageFile)

Zdroj:
IsolatedStorageFileStream.cs
Zdroj:
IsolatedStorageFileStream.cs
Zdroj:
IsolatedStorageFileStream.cs

Inicializuje novou instanci IsolatedStorageFileStream třídy, která poskytuje přístup k souboru určenému path v zadaném modesouboru , se zadaným souborem accessa v kontextu určeném IsolatedStorageFile nástrojem isf.

public:
 IsolatedStorageFileStream(System::String ^ path, System::IO::FileMode mode, System::IO::FileAccess access, System::IO::IsolatedStorage::IsolatedStorageFile ^ isf);
public IsolatedStorageFileStream (string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.IsolatedStorage.IsolatedStorageFile isf);
public IsolatedStorageFileStream (string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.IsolatedStorage.IsolatedStorageFile? isf);
new System.IO.IsolatedStorage.IsolatedStorageFileStream : string * System.IO.FileMode * System.IO.FileAccess * System.IO.IsolatedStorage.IsolatedStorageFile -> System.IO.IsolatedStorage.IsolatedStorageFileStream
Public Sub New (path As String, mode As FileMode, access As FileAccess, isf As IsolatedStorageFile)

Parametry

path
String

Relativní cesta k souboru v izolovaném úložišti.

mode
FileMode

Jedna z FileMode hodnot.

access
FileAccess

Bitové kombinace FileAccess hodnot.

Výjimky

Je path špatně formován.

Hodnota path je null.

Izolované úložiště je zavřené.

Nebyl nalezen žádný soubor a mode hodnota je nastavená na Open.

isf nemá kvótu.

Příklady

Následující příklad kódu ukazuje použití tohoto konstruktoru. Úplný kontext tohoto příkladu najdete v přehledu IsolatedStorageFileStream .

IsolatedStorageFile^ isoFile;
isoFile = IsolatedStorageFile::GetUserStoreForDomain();

// Open or create a writable file.
IsolatedStorageFileStream^ isoStream = gcnew IsolatedStorageFileStream( this->userName,FileMode::OpenOrCreate,FileAccess::Write,isoFile );
StreamWriter^ writer = gcnew StreamWriter( isoStream );
writer->WriteLine( this->NewsUrl );
writer->WriteLine( this->SportsUrl );

// Calculate the amount of space used to record the user's preferences.
double d = isoFile->CurrentSize / isoFile->MaximumSize;
Console::WriteLine( "CurrentSize = {0}", isoFile->CurrentSize.ToString() );
Console::WriteLine( "MaximumSize = {0}", isoFile->MaximumSize.ToString() );
writer->Close();
isoFile->Close();
isoStream->Close();
return d;
IsolatedStorageFile isoFile;
isoFile = IsolatedStorageFile.GetUserStoreForDomain();

// Open or create a writable file.
IsolatedStorageFileStream isoStream =
    new IsolatedStorageFileStream(this.userName,
    FileMode.OpenOrCreate,
    FileAccess.Write,
    isoFile);

StreamWriter writer = new StreamWriter(isoStream);
writer.WriteLine(this.NewsUrl);
writer.WriteLine(this.SportsUrl);
// Calculate the amount of space used to record the user's preferences.
double d = isoFile.CurrentSize / isoFile.MaximumSize;
Console.WriteLine("CurrentSize = " + isoFile.CurrentSize.ToString());
Console.WriteLine("MaximumSize = " + isoFile.MaximumSize.ToString());
// StreamWriter.Close implicitly closes isoStream.
writer.Close();
isoFile.Dispose();
isoFile.Close();
return d;
Dim isoFile As IsolatedStorageFile
isoFile = IsolatedStorageFile.GetUserStoreForDomain()

' Open or create a writable file.
Dim isoStream As New IsolatedStorageFileStream(Me.userName, FileMode.OpenOrCreate, _
    FileAccess.Write, isoFile)

Dim writer As New StreamWriter(isoStream)
writer.WriteLine(Me.NewsUrl)
writer.WriteLine(Me.SportsUrl)
' Calculate the amount of space used to record the user's preferences.
Dim d As Double = Convert.ToDouble(isoFile.CurrentSize) / Convert.ToDouble(isoFile.MaximumSize)
Console.WriteLine(("CurrentSize = " & isoFile.CurrentSize.ToString()))
Console.WriteLine(("MaximumSize = " & isoFile.MaximumSize.ToString()))
' StreamWriter.Close implicitly closes isoStream.
writer.Close()
isoFile.Dispose()
isoFile.Close()
Return d

Poznámky

Parametr mode označuje, jestli se má vytvořit nový soubor nebo použít existující soubor. Parametr access zahrnuje jen pro čtení, čtení/zápis a jen pro zápis.

Upozornění

Když zkompilujete sadu znaků s určitým kulturním nastavením a načtete stejné znaky s jiným kulturním nastavením, nemusí být znaky interpretovatelné a může způsobit vyvolání výjimky.

Platí pro

IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare, Int32)

Zdroj:
IsolatedStorageFileStream.cs
Zdroj:
IsolatedStorageFileStream.cs
Zdroj:
IsolatedStorageFileStream.cs

Inicializuje novou instanci IsolatedStorageFileStream třídy, která poskytuje přístup k souboru určenému pathv zadaném modesouboru se zadaným souborem accesspomocí režimu sdílení souborů určeného parametrem share, se zadaným buffersize .

public:
 IsolatedStorageFileStream(System::String ^ path, System::IO::FileMode mode, System::IO::FileAccess access, System::IO::FileShare share, int bufferSize);
public IsolatedStorageFileStream (string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, int bufferSize);
new System.IO.IsolatedStorage.IsolatedStorageFileStream : string * System.IO.FileMode * System.IO.FileAccess * System.IO.FileShare * int -> System.IO.IsolatedStorage.IsolatedStorageFileStream
Public Sub New (path As String, mode As FileMode, access As FileAccess, share As FileShare, bufferSize As Integer)

Parametry

path
String

Relativní cesta k souboru v izolovaném úložišti.

mode
FileMode

Jedna z FileMode hodnot.

access
FileAccess

Bitové kombinace FileAccess hodnot.

share
FileShare

Bitové kombinace FileShare hodnot.

bufferSize
Int32

Velikost FileStream vyrovnávací paměti.

Výjimky

Je path špatně formován.

Hodnota path je null.

Nebyl nalezen žádný soubor a mode vlastnost je nastavená na Openhodnotu .

Poznámky

Izolované úložiště, které se používá, je vymezeno identitou aktuálně spouštěného sestavení a identitou domény aplikace, ve které je spuštěno. Toto úložiště zůstane otevřené pouze po dobu životnosti objektu IsolatedStorageFileStream . Pokud chcete zadat jiný obor izolovaného úložiště nebo povolit, aby úložiště zůstalo otevřené (aby z něj bylo možné otevřít více IsolatedStorageFileStream objektů), použijte formu konstruktoru, který přijímá IsolatedStorageFile objekt.

Parametr mode určuje, jestli se má vytvořit nový soubor nebo použít existující soubor. Parametr access zahrnuje jen pro čtení, čtení/zápis a jen pro zápis.

Upozornění

Když zkompilujete sadu znaků s konkrétním kulturním nastavením a načtete stejné znaky s jiným kulturním nastavením, nemusí být tyto znaky interpretovatelné a mohou způsobit vyvolání výjimky.

Platí pro

IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare, IsolatedStorageFile)

Zdroj:
IsolatedStorageFileStream.cs
Zdroj:
IsolatedStorageFileStream.cs
Zdroj:
IsolatedStorageFileStream.cs

Inicializuje novou instanci IsolatedStorageFileStream třídy, která poskytuje přístup k souboru určenému uživatelem path, v zadaném modesouboru se zadaným souborem access, pomocí režimu sdílení souborů určeného parametrem sharea v kontextu IsolatedStorageFile určeném nástrojem isf.

public:
 IsolatedStorageFileStream(System::String ^ path, System::IO::FileMode mode, System::IO::FileAccess access, System::IO::FileShare share, System::IO::IsolatedStorage::IsolatedStorageFile ^ isf);
public IsolatedStorageFileStream (string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.IO.IsolatedStorage.IsolatedStorageFile isf);
public IsolatedStorageFileStream (string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.IO.IsolatedStorage.IsolatedStorageFile? isf);
new System.IO.IsolatedStorage.IsolatedStorageFileStream : string * System.IO.FileMode * System.IO.FileAccess * System.IO.FileShare * System.IO.IsolatedStorage.IsolatedStorageFile -> System.IO.IsolatedStorage.IsolatedStorageFileStream
Public Sub New (path As String, mode As FileMode, access As FileAccess, share As FileShare, isf As IsolatedStorageFile)

Parametry

path
String

Relativní cesta k souboru v izolovaném úložišti.

mode
FileMode

Jedna z FileMode hodnot.

access
FileAccess

Bitové kombinace FileAccess hodnot.

share
FileShare

Bitové kombinace FileShare hodnot.

Výjimky

Je path špatně tvarovaná.

Hodnota path je null.

Nebyl nalezen žádný soubor a mode vlastnost je nastavená na Openhodnotu .

isf nemá kvótu.

Příklady

Následující příklad kódu ukazuje použití tohoto konstruktoru. Úplný kontext tohoto příkladu najdete v přehledu IsolatedStorageFileStream .

// This is the stream to which data will be written.
IsolatedStorageFileStream^ source = gcnew IsolatedStorageFileStream( this->userName,FileMode::OpenOrCreate,isoFile );

// This is the stream from which data will be read.
Console::WriteLine( "Is the source file readable?  {0}", (source->CanRead ? (String^)"true" : "false") );
Console::WriteLine( "Creating new IsolatedStorageFileStream for Archive." );

// Open or create a writable file.
IsolatedStorageFileStream^ target = gcnew IsolatedStorageFileStream( String::Concat("Archive\\",this->userName),FileMode::OpenOrCreate,FileAccess::Write,FileShare::Write,isoFile );

IsolatedStorageFileStream source =
    new IsolatedStorageFileStream(this.userName, FileMode.OpenOrCreate,
    isoFile);
// This is the stream from which data will be read.
Console.WriteLine("Is the source file readable? " + (source.CanRead ? "true" : "false"));
Console.WriteLine("Creating new IsolatedStorageFileStream for Archive.");

// Open or create a writable file.
IsolatedStorageFileStream target =
    new IsolatedStorageFileStream("Archive\\ " + this.userName,
    FileMode.OpenOrCreate,
    FileAccess.Write,
    FileShare.Write,
    isoFile);
' Open or create a writable file.
Dim target As New IsolatedStorageFileStream("Archive\ " & Me.userName, _
     FileMode.OpenOrCreate, FileAccess.Write, FileShare.Write, isoFile)

Poznámky

Parametr mode určuje, jestli se má vytvořit nový soubor nebo použít existující soubor. Parametr access zahrnuje jen pro čtení, čtení/zápis a jen pro zápis.

Upozornění

Když zkompilujete sadu znaků s konkrétním kulturním nastavením a načtete stejné znaky s jiným kulturním nastavením, nemusí být tyto znaky interpretovatelné a mohou způsobit vyvolání výjimky.

Platí pro

IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare, Int32, IsolatedStorageFile)

Zdroj:
IsolatedStorageFileStream.cs
Zdroj:
IsolatedStorageFileStream.cs
Zdroj:
IsolatedStorageFileStream.cs

Inicializuje novou instanci IsolatedStorageFileStream třídy poskytující přístup k souboru určenému pathmodev zadaném souboru se zadaným souborem access, pomocí režimu sdílení souborů určeného parametrem share, se zadaným buffersize a v kontextu IsolatedStorageFile určeném nástrojem isf.

public:
 IsolatedStorageFileStream(System::String ^ path, System::IO::FileMode mode, System::IO::FileAccess access, System::IO::FileShare share, int bufferSize, System::IO::IsolatedStorage::IsolatedStorageFile ^ isf);
public IsolatedStorageFileStream (string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, int bufferSize, System.IO.IsolatedStorage.IsolatedStorageFile? isf);
public IsolatedStorageFileStream (string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, int bufferSize, System.IO.IsolatedStorage.IsolatedStorageFile isf);
new System.IO.IsolatedStorage.IsolatedStorageFileStream : string * System.IO.FileMode * System.IO.FileAccess * System.IO.FileShare * int * System.IO.IsolatedStorage.IsolatedStorageFile -> System.IO.IsolatedStorage.IsolatedStorageFileStream
Public Sub New (path As String, mode As FileMode, access As FileAccess, share As FileShare, bufferSize As Integer, isf As IsolatedStorageFile)

Parametry

path
String

Relativní cesta k souboru v izolovaném úložišti.

mode
FileMode

Jedna z FileMode hodnot.

access
FileAccess

Bitové kombinace FileAccess hodnot.

share
FileShare

Bitové kombinace FileShare hodnot.

bufferSize
Int32

Velikost FileStream vyrovnávací paměti.

Výjimky

Je path špatně tvarovaná.

Hodnota path je null.

Nebyl nalezen žádný soubor a mode vlastnost je nastavená na Openhodnotu .

isf nemá kvótu.

Příklady

Následující příklad kódu ukazuje použití tohoto konstruktoru. Úplný kontext tohoto příkladu najdete v přehledu IsolatedStorageFileStream .

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

Poznámky

Parametr mode určuje, jestli se má vytvořit nový soubor nebo použít existující soubor. Parametr access zahrnuje jen pro čtení, čtení/zápis a jen pro zápis.

Upozornění

Když zkompilujete sadu znaků s konkrétním kulturním nastavením a načtete stejné znaky s jiným kulturním nastavením, nemusí být tyto znaky interpretovatelné a mohou způsobit vyvolání výjimky.

Platí pro