IsolatedStorageFile.CurrentSize 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
IsolatedStorageFile.CurrentSize has been deprecated because it is not CLS Compliant. To get the current size use IsolatedStorageFile.UsedSize
注意
IsolatedStorageFile.CurrentSize has been deprecated because it is not CLS Compliant. To get the current size use IsolatedStorageFile.UsedSize instead.
重要
此 API 不符合 CLS。
获取独立存储的当前大小。
public:
virtual property System::UInt64 CurrentSize { System::UInt64 get(); };
[System.CLSCompliant(false)]
[System.Obsolete("IsolatedStorageFile.CurrentSize has been deprecated because it is not CLS Compliant. To get the current size use IsolatedStorageFile.UsedSize")]
public override ulong CurrentSize { get; }
[System.CLSCompliant(false)]
[System.Obsolete("IsolatedStorageFile.CurrentSize has been deprecated because it is not CLS Compliant. To get the current size use IsolatedStorageFile.UsedSize instead.")]
public override ulong CurrentSize { get; }
[System.CLSCompliant(false)]
public override ulong CurrentSize { get; }
[<System.CLSCompliant(false)>]
[<System.Obsolete("IsolatedStorageFile.CurrentSize has been deprecated because it is not CLS Compliant. To get the current size use IsolatedStorageFile.UsedSize")>]
member this.CurrentSize : uint64
[<System.CLSCompliant(false)>]
[<System.Obsolete("IsolatedStorageFile.CurrentSize has been deprecated because it is not CLS Compliant. To get the current size use IsolatedStorageFile.UsedSize instead.")>]
member this.CurrentSize : uint64
[<System.CLSCompliant(false)>]
member this.CurrentSize : uint64
Public Overrides ReadOnly Property CurrentSize As ULong
属性值
独立存储范围中当前正在使用的存储区的总字节数。
- 属性
例外
该属性不可用。 当前存储区有漫游范围或者没有打开。
未定义当前对象的大小。
示例
下面的代码示例演示 了 CurrentSize 属性。 有关此示例的完整上下文,请参阅 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()))
注解
表示独立存储范围内所有文件和目录的总使用量。
无法准确确定参与漫游用户配置文件的存储的当前大小。 由于漫游配置文件通常缓存在多台客户端计算机上,以后会与服务器同步,因此无法对此类存储强制实施配额,并且不会报告当前大小。
如何:使用独立存储预测空间不足情况示例演示了 属性CurrentSize的使用。