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 несовместим с 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()))

Комментарии

Представляет общее использование всех файлов и каталогов в область изолированного хранилища.

Текущий размер невозможно точно определить для магазинов, участвующих в перемещаемом профиле пользователя. Так как перемещаемые профили часто кэшируются на нескольких клиентских компьютерах, а затем синхронизируются с сервером, квоты не могут применяться для таких хранилищ, а текущий размер не сообщается.

В примере How to: Anticipate Out-of-Space Conditions with Isolated Storage (Практическое руководство. Предвидеть условия вне пространства с помощью изолированногоCurrentSize хранилища) показано использование свойства .

Применяется к

См. также раздел