IsolatedStorageFileStream 构造函数

定义

初始化 IsolatedStorageFileStream 类的新实例。 打开 IsolatedStorageFileStream 的唯一方法是使用它的一个构造函数。

重载

IsolatedStorageFileStream(String, FileMode)

初始化 IsolatedStorageFileStream 对象的新实例,通过该实例可以访问指定 mode 中的 path 指定的文件。

IsolatedStorageFileStream(String, FileMode, FileAccess)

初始化 IsolatedStorageFileStream 类的一个新实例,以便可以指定的 mode、用请求类型的 access 访问 path 所指定的文件。

IsolatedStorageFileStream(String, FileMode, IsolatedStorageFile)

初始化 IsolatedStorageFileStream 类的一个新实例,以便可以在 isf 指定的 IsolatedStorageFile 的上下文中,以指定的 mode 来访问 path 所指定的文件。

IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare)

初始化 IsolatedStorageFileStream 类的一个新实例,以便可以使用 path 指定的文件共享模式,以指定的 mode、用指定的文件 access 访问 share 所指定的文件。

IsolatedStorageFileStream(String, FileMode, FileAccess, IsolatedStorageFile)

初始化 IsolatedStorageFileStream 类的一个新实例,以便可以在 isf 所指定的 IsolatedStorageFile 的上下文中,以指定的 mode、用指定的文件 access 来访问 path 所指定的文件。

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

初始化 IsolatedStorageFileStream 类的一个新实例,以便可以使用 share 指定的文件共享模式(指定了 buffersize),以指定的 mode、用指定的文件 access 访问 path 所指定的文件。

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

初始化 IsolatedStorageFileStream 类的一个新实例,以便可以在 isf 指定的 IsolatedStorageFile 的上下文中,使用 share 指定的文件共享模式,以指定的 mode、用指定的文件 access 来访问 path 所指定的文件。

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

初始化 IsolatedStorageFileStream 类的一个新实例,以便可以在 path 指定的 mode 的上下文中,使用 access 指定的文件享模式(指定了 share),以指定的 buffersize、用指定的文件 IsolatedStorageFile 来访问 isf 所指定的文件。

IsolatedStorageFileStream(String, FileMode)

Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs

初始化 IsolatedStorageFileStream 对象的新实例,通过该实例可以访问指定 mode 中的 path 指定的文件。

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)

参数

path
String

独立存储区内文件的相对路径。

mode
FileMode

FileMode 值之一。

例外

path 的格式不正确。

pathnull

path 中的目录不存在。

未找到任何文件,且 mode 设置为 Open

注解

所使用的独立存储按当前正在执行的程序集的标识和运行它的应用程序域的标识来限定。 此存储仅在对象的生存期内 IsolatedStorageFileStream 保持打开状态。 若要指定不同的独立存储范围,或允许存储保持打开 (以便可以从中打开多个 IsolatedStorageFileStream 对象) ,请使用接受 IsolatedStorageFile 对象的构造函数的形式。

参数 mode 指示是否应创建新文件、使用现有文件等。

注意

编译具有特定区域性设置的一组字符并检索具有不同区域性设置的相同字符时,这些字符可能无法解释,并可能导致引发异常。

适用于

IsolatedStorageFileStream(String, FileMode, FileAccess)

Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs

初始化 IsolatedStorageFileStream 类的一个新实例,以便可以指定的 mode、用请求类型的 access 访问 path 所指定的文件。

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)

参数

path
String

独立存储区内文件的相对路径。

mode
FileMode

FileMode 值之一。

access
FileAccess

FileAccess 值的按位组合。

例外

path 的格式不正确。

pathnull

未找到任何文件,且 mode 设置为 Open

注解

所使用的独立存储按当前正在执行的程序集的标识和运行它的应用程序域的标识来限定。 此存储仅在对象的生存期内 IsolatedStorageFileStream 保持打开状态。 若要指定不同的独立存储范围,或允许存储保持打开 (以便可以从中打开多个 IsolatedStorageFileStream 对象) ,请使用接受 IsolatedStorageFile 对象的构造函数的形式。

参数 mode 指示是应创建新文件还是应使用现有文件。 参数 access 包括只读、读/写和只写。

注意

编译具有特定区域性设置的一组字符并检索具有不同区域性设置的相同字符时,这些字符可能无法解释,并可能导致引发异常。

适用于

IsolatedStorageFileStream(String, FileMode, IsolatedStorageFile)

Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs

初始化 IsolatedStorageFileStream 类的一个新实例,以便可以在 isf 指定的 IsolatedStorageFile 的上下文中,以指定的 mode 来访问 path 所指定的文件。

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)

参数

path
String

独立存储区内文件的相对路径。

mode
FileMode

FileMode 值之一。

例外

path 的格式不正确。

pathnull

未找到任何文件,且 mode 设置为 Open

isf 无配额。

示例

下面的代码示例演示如何使用此构造函数。 有关此示例的完整上下文,请参阅 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)

注解

参数 mode 指示是否应创建新文件、使用现有文件等。

注意

编译具有特定区域性设置的一组字符并检索具有不同区域性设置的相同字符时,这些字符可能无法解释,并可能导致引发异常。

适用于

IsolatedStorageFileStream(String, FileMode, FileAccess, FileShare)

Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs

初始化 IsolatedStorageFileStream 类的一个新实例,以便可以使用 path 指定的文件共享模式,以指定的 mode、用指定的文件 access 访问 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)

参数

path
String

独立存储区内文件的相对路径。

mode
FileMode

FileMode 值之一。

access
FileAccess

FileAccess 值的按位组合。

share
FileShare

FileShare 值的按位组合。

例外

path 的格式不正确。

pathnull

未找到任何文件,且 mode 设置为 Open

示例

下面的代码示例演示如何使用此构造函数。 有关此示例的完整上下文,请参阅 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)

注解

所使用的独立存储按当前正在执行的程序集的标识和运行它的应用程序域的标识来限定。 此存储仅在对象的生存期内 IsolatedStorageFileStream 保持打开状态。 若要指定不同的独立存储范围,或允许存储保持打开 (以便可以从中打开多个 IsolatedStorageFileStream 对象) ,请使用接受 IsolatedStorageFile 对象的构造函数的形式。

注意

编译具有特定区域性设置的一组字符并检索具有不同区域性设置的相同字符时,这些字符可能无法解释,并可能导致引发异常。

适用于

IsolatedStorageFileStream(String, FileMode, FileAccess, IsolatedStorageFile)

Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs

初始化 IsolatedStorageFileStream 类的一个新实例,以便可以在 isf 所指定的 IsolatedStorageFile 的上下文中,以指定的 mode、用指定的文件 access 来访问 path 所指定的文件。

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)

参数

path
String

独立存储区内文件的相对路径。

mode
FileMode

FileMode 值之一。

access
FileAccess

FileAccess 值的按位组合。

例外

path 的格式不正确。

pathnull

独立存储关闭。

未找到任何文件,且 mode 设置为 Open

isf 无配额。

示例

下面的代码示例演示如何使用此构造函数。 有关此示例的完整上下文,请参阅 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

注解

参数 mode 指示是应创建新文件还是应使用现有文件。 参数 access 包括只读、读/写和只写。

注意

编译具有特定区域性设置的一组字符并检索具有不同区域性设置的相同字符时,这些字符可能无法解释,并可能导致引发异常。

适用于

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

Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs

初始化 IsolatedStorageFileStream 类的一个新实例,以便可以使用 share 指定的文件共享模式(指定了 buffersize),以指定的 mode、用指定的文件 access 访问 path 所指定的文件。

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)

参数

path
String

独立存储区内文件的相对路径。

mode
FileMode

FileMode 值之一。

access
FileAccess

FileAccess 值的按位组合。

share
FileShare

FileShare 值的按位组合。

bufferSize
Int32

FileStream 缓冲区的大小。

例外

path 的格式不正确。

pathnull

未找到任何文件,且 mode 设置为 Open

注解

所使用的独立存储按当前正在执行的程序集的标识和运行它的应用程序域的标识来限定。 此存储仅在对象的生存期内 IsolatedStorageFileStream 保持打开状态。 若要指定不同的独立存储范围,或允许存储保持打开 (以便可以从中打开多个 IsolatedStorageFileStream 对象) ,请使用接受 IsolatedStorageFile 对象的构造函数的形式。

参数 mode 指示是应创建新文件还是应使用现有文件。 参数 access 包括只读、读/写和只写。

注意

编译具有特定区域性设置的一组字符并检索具有不同区域性设置的相同字符时,这些字符可能无法解释,并可能导致引发异常。

适用于

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

Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs

初始化 IsolatedStorageFileStream 类的一个新实例,以便可以在 isf 指定的 IsolatedStorageFile 的上下文中,使用 share 指定的文件共享模式,以指定的 mode、用指定的文件 access 来访问 path 所指定的文件。

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)

参数

path
String

独立存储区内文件的相对路径。

mode
FileMode

FileMode 值之一。

access
FileAccess

FileAccess 值的按位组合。

share
FileShare

FileShare 值的按位组合。

例外

path 的格式不正确。

pathnull

未找到任何文件,且 mode 设置为 Open

isf 无配额。

示例

下面的代码示例演示如何使用此构造函数。 有关此示例的完整上下文,请参阅 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)

注解

参数 mode 指示是应创建新文件还是应使用现有文件。 参数 access 包括只读、读/写和只写。

注意

编译具有特定区域性设置的一组字符并检索具有不同区域性设置的相同字符时,这些字符可能无法解释,并可能导致引发异常。

适用于

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

Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs

初始化 IsolatedStorageFileStream 类的一个新实例,以便可以在 path 指定的 mode 的上下文中,使用 access 指定的文件享模式(指定了 share),以指定的 buffersize、用指定的文件 IsolatedStorageFile 来访问 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)

参数

path
String

独立存储区内文件的相对路径。

mode
FileMode

FileMode 值之一。

access
FileAccess

FileAccess 值的按位组合。

share
FileShare

FileShare 值的按位组合。

bufferSize
Int32

FileStream 缓冲区的大小。

例外

path 的格式不正确。

pathnull

未找到任何文件,且 mode 设置为 Open

isf 无配额。

示例

下面的代码示例演示如何使用此构造函数。 有关此示例的完整上下文,请参阅 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)

注解

参数 mode 指示是应创建新文件还是应使用现有文件。 参数 access 包括只读、读/写和只写。

注意

编译具有特定区域性设置的一组字符并检索具有不同区域性设置的相同字符时,这些字符可能无法解释,并可能导致引发异常。

适用于