IsolatedStorageFile.CurrentSize プロパティ

定義

注意事項

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 は非推奨になりました。

重要

この 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]
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
[<System.CLSCompliant(false)>]
[<System.Obsolete>]
member this.CurrentSize : uint64
Public Overrides ReadOnly Property CurrentSize As ULong

プロパティ値

UInt64

分離ストレージのスコープ内で現在使用されているストレージの合計バイト数。

属性

例外

プロパティが使用できません。 現在のストアは、ローミング スコープが指定されているか、または開いていません。

現在のオブジェクト サイズが未定義です。

プロパティを示すコード例を次に 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()))

注釈

分離ストレージ スコープ内のすべてのファイルとディレクトリの合計使用量を表します。

現在のサイズは、ローミング ユーザー プロファイルに参加しているストアでは正確に決定できません。 ローミング プロファイルは多くの場合、複数のクライアント コンピューターにキャッシュされ、後でサーバーと同期されるため、このようなストアにクォータを適用できず、現在のサイズは報告されません。

方法: 分離されたStorageを使用して領域不足状態を予測する例では、プロパティの使用方法をCurrentSize示します。

適用対象

こちらもご覧ください