IsolatedStorageFile.MaximumSize 属性

定义

注意

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

注意

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

重要

此 API 不符合 CLS。

获取一个值,该值表示在由配额设定的限制内独立存储的最大可用空间。

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

属性值

独立存储空间的限制,以字节为单位。

属性

例外

该属性不可用。 如果没有来自程序集创建过程的证据,则无法确定 MaximumSize。 创建该对象时未能确定证据。

发生独立存储错误。

示例

下面的代码示例演示 了 MaximumSize 属性。 有关此示例的完整上下文,请参阅 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()))

注解

可用字节数受管理员设置的独立存储配额的约束。 配额是在安全策略中基于证据配置的,因此,如果同一代码使用不同的证据运行,则可能会收到不同的配额。 例如,在本地以及从 Intranet 上的共享运行的应用程序可能会收到不同的配额。

如何:使用独立存储预测空间不足情况示例演示了 属性MaximumSize的使用。

适用于

另请参阅