IsolatedStorageFile::Close Method ()
.NET Framework (current version)
Closes a store previously opened with GetStore, GetUserStoreForAssembly, or GetUserStoreForDomain.
Assembly: mscorlib (in mscorlib.dll)
The following code example demonstrates how to use the Close method. For the complete context of this example, see the IsolatedStorageFile overview.
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;
ReflectionPermission
when invoked late-bound through mechanisms such as Type::InvokeMember. Associated enumeration: ReflectionPermissionFlag::MemberAccess
.NET Framework
Available since 1.1
Available since 1.1
Show: