Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IsolatedStorageFile::Close Method ()

 

Closes a store previously opened with GetStore, GetUserStoreForAssembly, or GetUserStoreForDomain.

Namespace:   System.IO.IsolatedStorage
Assembly:  mscorlib (in mscorlib.dll)

public:
void Close()

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
Return to top
Show:
© 2017 Microsoft