IsolatedStorageFileStream Konstruktory
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Inicjuje nowe wystąpienie klasy IsolatedStorageFileStream. Jedynym sposobem otwarcia obiektu IsolatedStorageFileStream jest użycie jednego z jego konstruktorów.
Przeciążenia
| Nazwisko | Opis |
|---|---|
| IsolatedStorageFileStream(String, FileMode) |
Inicjuje nowe wystąpienie IsolatedStorageFileStream obiektu dające dostęp do pliku wyznaczonego przez |
| IsolatedStorageFileStream(String, FileMode, FileAccess) |
Inicjuje IsolatedStorageFileStream nowe wystąpienie klasy dające dostęp do pliku wyznaczonego przez |
| IsolatedStorageFileStream(String, FileMode, IsolatedStorageFile) |
Inicjuje nowe wystąpienie IsolatedStorageFileStream klasy dające dostęp do pliku wyznaczonego przez |
| IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare) |
Inicjuje nowe wystąpienie IsolatedStorageFileStream klasy dające dostęp do pliku wyznaczonego przez |
| IsolatedStorageFileStream(String, FileMode, FileAccess, IsolatedStorageFile) |
Inicjuje nowe wystąpienie IsolatedStorageFileStream klasy dające dostęp do pliku wyznaczonego przez |
| IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare, Int32) |
Inicjuje nowe wystąpienie IsolatedStorageFileStream klasy dające dostęp do pliku wyznaczonego przez |
| IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare, IsolatedStorageFile) |
Inicjuje nowe wystąpienie IsolatedStorageFileStream klasy dające dostęp do pliku wyznaczonego przez |
| IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare, Int32, IsolatedStorageFile) |
Inicjuje nowe wystąpienie IsolatedStorageFileStream klasy dające dostęp do pliku wyznaczonego przez |
IsolatedStorageFileStream(String, FileMode)
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
Inicjuje nowe wystąpienie IsolatedStorageFileStream obiektu dające dostęp do pliku wyznaczonego przez path w określonym modeobiekcie .
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
Ścieżka względna pliku w izolowanym magazynie.
Wyjątki
Jest path źle sformułowany.
path jest null.
Katalog w path pliku nie istnieje.
Nie znaleziono pliku i ustawiono mode wartość Open
Uwagi
Izolowany magazyn, który jest używany, jest zakresem bieżącego wykonywania tożsamości zestawu i domeny aplikacji, w której jest uruchomiona. Ten magazyn pozostanie otwarty tylko przez okres istnienia IsolatedStorageFileStream obiektu. Aby określić inny izolowany zakres magazynu lub zezwolić magazynowi na pozostanie otwartym (aby można było otworzyć z niego wiele IsolatedStorageFileStream obiektów), użyj formularza konstruktora, który akceptuje IsolatedStorageFile obiekt.
Parametr mode wskazuje, czy należy utworzyć nowy plik, istniejący używany i tak dalej.
Caution
Podczas kompilowania zestawu znaków z określonym ustawieniem kulturowym i pobierania tych samych znaków z innym ustawieniem kulturowym znaki mogą nie być interpretowane i mogą powodować zgłoszenie wyjątku.
Dotyczy
IsolatedStorageFileStream(String, FileMode, FileAccess)
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
Inicjuje IsolatedStorageFileStream nowe wystąpienie klasy dające dostęp do pliku wyznaczonego przez pathelement w określonym modeobiekcie o żądanym access typie.
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
Ścieżka względna pliku w izolowanym magazynie.
- access
- FileAccess
Bitowa kombinacja FileAccess wartości.
Wyjątki
Jest path źle sformułowany.
path jest null.
Nie znaleziono pliku i mode ustawiono wartość Open.
Uwagi
Izolowany magazyn, który jest używany, jest zakresem bieżącego wykonywania tożsamości zestawu i domeny aplikacji, w której jest uruchomiona. Ten magazyn pozostanie otwarty tylko przez okres istnienia IsolatedStorageFileStream obiektu. Aby określić inny izolowany zakres magazynu lub zezwolić magazynowi na pozostanie otwartym (aby można było otworzyć z niego wiele IsolatedStorageFileStream obiektów), użyj formularza konstruktora, który akceptuje IsolatedStorageFile obiekt.
Parametr mode wskazuje, czy należy utworzyć nowy plik, czy istniejący. Parametr access zawiera tylko do odczytu, odczytu/zapisu i tylko do zapisu.
Caution
Podczas kompilowania zestawu znaków z określonym ustawieniem kulturowym i pobierania tych samych znaków z innym ustawieniem kulturowym znaki mogą nie być interpretowane i mogą powodować zgłoszenie wyjątku.
Dotyczy
IsolatedStorageFileStream(String, FileMode, IsolatedStorageFile)
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
Inicjuje nowe wystąpienie IsolatedStorageFileStream klasy dające dostęp do pliku wyznaczonego przez path, w określonym modepliku i w kontekście określonego IsolatedStorageFile przez 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
Ścieżka względna pliku w izolowanym magazynie.
Element IsolatedStorageFile , w którym należy otworzyć plik IsolatedStorageFileStream.
Wyjątki
Jest path źle sformułowany.
path jest null.
Nie znaleziono pliku i mode ustawiono wartość Open.
isf nie ma limitu przydziału.
Przykłady
W poniższym przykładzie kodu pokazano użycie tego konstruktora. Pełny kontekst tego przykładu zawiera IsolatedStorageFileStream omówienie.
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)
Uwagi
Parametr mode wskazuje, czy należy utworzyć nowy plik, istniejący używany i tak dalej.
Caution
Podczas kompilowania zestawu znaków z określonym ustawieniem kulturowym i pobierania tych samych znaków z innym ustawieniem kulturowym znaki mogą nie być interpretowane i mogą powodować zgłoszenie wyjątku.
Dotyczy
IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare)
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
Inicjuje nowe wystąpienie IsolatedStorageFileStream klasy dające dostęp do pliku wyznaczonego przez path, w określonym pliku z określonym modeplikiem access, przy użyciu trybu udostępniania plików określonego przez 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
Ścieżka względna pliku w izolowanym magazynie.
- access
- FileAccess
Bitowa kombinacja FileAccess wartości.
Wyjątki
Jest path źle sformułowany.
path jest null.
Nie znaleziono pliku i mode ustawiono wartość Open.
Przykłady
W poniższym przykładzie kodu pokazano użycie tego konstruktora. Pełny kontekst tego przykładu zawiera IsolatedStorageFileStream omówienie.
// 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)
Uwagi
Izolowany magazyn, który jest używany, jest zakresem bieżącego wykonywania tożsamości zestawu i domeny aplikacji, w której jest uruchomiona. Ten magazyn pozostanie otwarty tylko przez okres istnienia IsolatedStorageFileStream obiektu. Aby określić inny izolowany zakres magazynu lub zezwolić magazynowi na pozostanie otwartym (aby można było otworzyć z niego wiele IsolatedStorageFileStream obiektów), użyj formularza konstruktora, który akceptuje IsolatedStorageFile obiekt.
Caution
Podczas kompilowania zestawu znaków z określonym ustawieniem kulturowym i pobierania tych samych znaków z innym ustawieniem kulturowym znaki mogą nie być interpretowane i mogą powodować zgłoszenie wyjątku.
Dotyczy
IsolatedStorageFileStream(String, FileMode, FileAccess, IsolatedStorageFile)
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
Inicjuje nowe wystąpienie IsolatedStorageFileStream klasy dające dostęp do pliku wyznaczonego przez path w określonym pliku , z określonym modeplikiem accessi w kontekście określonego IsolatedStorageFile przez 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
Ścieżka względna pliku w izolowanym magazynie.
- access
- FileAccess
Bitowa kombinacja FileAccess wartości.
Element IsolatedStorageFile , w którym należy otworzyć plik IsolatedStorageFileStream.
Wyjątki
Jest path źle sformułowany.
path jest null.
Izolowany magazyn jest zamknięty.
Nie znaleziono pliku i mode ustawiono wartość Open.
isf nie ma limitu przydziału.
Przykłady
W poniższym przykładzie kodu pokazano użycie tego konstruktora. Pełny kontekst tego przykładu zawiera IsolatedStorageFileStream omówienie.
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
Uwagi
Parametr mode wskazuje, czy należy utworzyć nowy plik, czy istniejący. Parametr access zawiera tylko do odczytu, odczytu/zapisu i tylko do zapisu.
Caution
Podczas kompilowania zestawu znaków z określonym ustawieniem kulturowym i pobierania tych samych znaków z innym ustawieniem kulturowym znaki mogą nie być interpretowane i mogą powodować zgłoszenie wyjątku.
Dotyczy
IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare, Int32)
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
Inicjuje nowe wystąpienie IsolatedStorageFileStream klasy dające dostęp do pliku wyznaczonego przez path, w określonym pliku z określonym modeplikiem access, przy użyciu trybu udostępniania plików określonego przez share, z bufferSize określonym.
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
Ścieżka względna pliku w izolowanym magazynie.
- access
- FileAccess
Bitowa kombinacja FileAccess wartości.
- bufferSize
- Int32
Rozmiar buforu FileStream .
Wyjątki
Jest path źle sformułowany.
path jest null.
Nie znaleziono pliku i mode ustawiono wartość Open.
Uwagi
Izolowany magazyn, który jest używany, jest zakresem bieżącego wykonywania tożsamości zestawu i domeny aplikacji, w której jest uruchomiona. Ten magazyn pozostanie otwarty tylko przez okres istnienia IsolatedStorageFileStream obiektu. Aby określić inny izolowany zakres magazynu lub zezwolić magazynowi na pozostanie otwartym (aby można było otworzyć z niego wiele IsolatedStorageFileStream obiektów), użyj formularza konstruktora, który akceptuje IsolatedStorageFile obiekt.
Parametr mode wskazuje, czy należy utworzyć nowy plik, czy istniejący. Parametr access zawiera tylko do odczytu, odczytu/zapisu i tylko do zapisu.
Caution
Podczas kompilowania zestawu znaków z określonym ustawieniem kulturowym i pobierania tych samych znaków z innym ustawieniem kulturowym znaki mogą nie być interpretowane i mogą powodować zgłoszenie wyjątku.
Dotyczy
IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare, IsolatedStorageFile)
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
Inicjuje nowe wystąpienie IsolatedStorageFileStream klasy dające dostęp do pliku wyznaczonego przez path, w określonym pliku , z określonym modeplikiem access, przy użyciu trybu udostępniania plików określonego przez share, i w kontekście określonego IsolatedStorageFile przez 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
Ścieżka względna pliku w izolowanym magazynie.
- access
- FileAccess
Bitowa kombinacja FileAccess wartości.
Element IsolatedStorageFile , w którym należy otworzyć plik IsolatedStorageFileStream.
Wyjątki
Jest path źle sformułowany.
path jest null.
Nie znaleziono pliku i mode ustawiono wartość Open.
isf nie ma limitu przydziału.
Przykłady
W poniższym przykładzie kodu pokazano użycie tego konstruktora. Pełny kontekst tego przykładu zawiera IsolatedStorageFileStream omówienie.
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)
Uwagi
Parametr mode wskazuje, czy należy utworzyć nowy plik, czy istniejący. Parametr access zawiera tylko do odczytu, odczytu/zapisu i tylko do zapisu.
Caution
Podczas kompilowania zestawu znaków z określonym ustawieniem kulturowym i pobierania tych samych znaków z innym ustawieniem kulturowym znaki mogą nie być interpretowane i mogą powodować zgłoszenie wyjątku.
Dotyczy
IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare, Int32, IsolatedStorageFile)
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
- Źródło:
- IsolatedStorageFileStream.cs
Inicjuje nowe wystąpienie IsolatedStorageFileStream klasy dające dostęp do pliku wyznaczonego przez path, w określonym pliku , z określonym modeplikiem access, przy użyciu trybu udostępniania plików określonego przez share, z bufferSize określonym i w kontekście IsolatedStorageFile określonym przez 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
Ścieżka względna pliku w izolowanym magazynie.
- access
- FileAccess
Bitowa kombinacja FileAccess wartości.
- bufferSize
- Int32
Rozmiar buforu FileStream .
Element IsolatedStorageFile , w którym należy otworzyć plik IsolatedStorageFileStream.
Wyjątki
Jest path źle sformułowany.
path jest null.
Nie znaleziono pliku i mode ustawiono wartość Open.
isf nie ma limitu przydziału.
Przykłady
W poniższym przykładzie kodu pokazano użycie tego konstruktora. Pełny kontekst tego przykładu zawiera IsolatedStorageFileStream omówienie.
// 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)
Uwagi
Parametr mode wskazuje, czy należy utworzyć nowy plik, czy istniejący. Parametr access zawiera tylko do odczytu, odczytu/zapisu i tylko do zapisu.
Caution
Podczas kompilowania zestawu znaków z określonym ustawieniem kulturowym i pobierania tych samych znaków z innym ustawieniem kulturowym znaki mogą nie być interpretowane i mogą powodować zgłoszenie wyjątku.