Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
 MaximumSize Property
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
IsolatedStorageFile..::.MaximumSize Property

Gets a value representing the maximum amount of space available for isolated storage within the limits established by the quota.

This API is not CLS-compliant. 

Namespace:  System.IO.IsolatedStorage
Assembly:  mscorlib (in mscorlib.dll)
Visual Basic (Declaration)
<CLSCompliantAttribute(False)> _
Public Overrides ReadOnly Property MaximumSize As ULong
Visual Basic (Usage)
Dim instance As IsolatedStorageFile
Dim value As ULong

value = instance.MaximumSize
C#
[CLSCompliantAttribute(false)]
public override ulong MaximumSize { get; }
Visual C++
[CLSCompliantAttribute(false)]
public:
virtual property unsigned long long MaximumSize {
    unsigned long long get () override;
}
JScript
public override function get MaximumSize () : ulong

Property Value

Type: System..::.UInt64
The limit of isolated storage space in bytes.
ExceptionCondition
InvalidOperationException

The property is unavailable. MaximumSize cannot be determined without evidence from the assembly's creation. The evidence could not be determined when the object was created.

The number of bytes available is constrained by the isolated storage quota set by the administrator. Quota is configured in security policy on the basis of evidence, so the same code can receive a different quota if it is run with different evidence. For example, an application that is run locally and also from a share on an intranet would likely receive different quotas.

The How to: Anticipate Out of Space Conditions with Isolated Storage example demonstrates the use of the MaximumSize property.

The following code example demonstrates the MaximumSize property. For the complete context of this example, see the IsolatedStorageFile overview.

Visual Basic
Dim writer As New StreamWriter(isoStream)
' Update the data based on the new inputs.
writer.WriteLine(Me.NewsUrl)
writer.WriteLine(Me.SportsUrl)

'  Calculate the amount of space used to record this 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()))
C#
StreamWriter writer = new StreamWriter(isoStream);
// Update the data based on the new inputs.
writer.WriteLine(this.NewsUrl);
writer.WriteLine(this.SportsUrl);

// Calculate the amount of space used to record this user's preferences.
double d = isoFile.CurrentSize / isoFile.MaximumSize;
Console.WriteLine("CurrentSize = " + isoFile.CurrentSize.ToString());
Console.WriteLine("MaximumSize = " + isoFile.MaximumSize.ToString());
Visual C++
StreamWriter^ writer = gcnew StreamWriter( isoStream );

// Update the data based on the new inputs.
writer->WriteLine( this->NewsUrl );
writer->WriteLine( this->SportsUrl );

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

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker