IsolatedStorageFile.MaximumSize Właściwość

Definicja

Przestroga

IsolatedStorageFile.MaximumSize has been deprecated because it is not CLS Compliant. To get the maximum size use IsolatedStorageFile.Quota

Przestroga

IsolatedStorageFile.MaximumSize has been deprecated because it is not CLS Compliant. To get the maximum size use IsolatedStorageFile.Quota instead.

Ważne

Ten interfejs API nie jest zgodny ze specyfikacją CLS.

Pobiera wartość reprezentującą maksymalną ilość miejsca dostępnego dla izolowanego magazynu w granicach ustalonych przez limit przydziału.

public:
 virtual property System::UInt64 MaximumSize { System::UInt64 get(); };
[System.CLSCompliant(false)]
[System.Obsolete("IsolatedStorageFile.MaximumSize has been deprecated because it is not CLS Compliant.  To get the maximum size use IsolatedStorageFile.Quota")]
public override ulong MaximumSize { get; }
[System.CLSCompliant(false)]
[System.Obsolete("IsolatedStorageFile.MaximumSize has been deprecated because it is not CLS Compliant. To get the maximum size use IsolatedStorageFile.Quota instead.")]
public override ulong MaximumSize { get; }
[System.CLSCompliant(false)]
public override ulong MaximumSize { get; }
[<System.CLSCompliant(false)>]
[<System.Obsolete("IsolatedStorageFile.MaximumSize has been deprecated because it is not CLS Compliant.  To get the maximum size use IsolatedStorageFile.Quota")>]
member this.MaximumSize : uint64
[<System.CLSCompliant(false)>]
[<System.Obsolete("IsolatedStorageFile.MaximumSize has been deprecated because it is not CLS Compliant. To get the maximum size use IsolatedStorageFile.Quota instead.")>]
member this.MaximumSize : uint64
[<System.CLSCompliant(false)>]
member this.MaximumSize : uint64
Public Overrides ReadOnly Property MaximumSize As ULong

Wartość właściwości

Limit izolowanego miejsca do magazynowania w bajtach.

Atrybuty

Wyjątki

Właściwość jest niedostępna. MaximumSize nie można ustalić bez dowodów na utworzenie zestawu. Nie można ustalić dowodów podczas tworzenia obiektu.

Wystąpił izolowany błąd magazynu.

Przykłady

Poniższy przykład kodu przedstawia MaximumSize właściwość . Pełny kontekst tego przykładu zawiera omówienie IsolatedStorageFile .

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() );
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());
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()))

Uwagi

Liczba dostępnych bajtów jest ograniczona przez izolowany limit przydziału magazynu ustawiony przez administratora. Limit przydziału jest konfigurowany w zasadach zabezpieczeń na podstawie dowodów, więc ten sam kod może otrzymać inny limit przydziału, jeśli jest uruchamiany z różnymi dowodami. Na przykład aplikacja, która jest uruchamiana lokalnie, a także z udziału w intranecie, prawdopodobnie otrzyma różne limity przydziału.

Instrukcje: przewidywanie warunków braku miejsca przy użyciu przykładu MaximumSize izolowanego magazynu pokazuje użycie właściwości.

Dotyczy

Zobacz też