Bagikan melalui


IsolatedStorageFile.CurrentSize Properti

Definisi

Perhatian

IsolatedStorageFile.CurrentSize has been deprecated because it is not CLS Compliant. To get the current size use IsolatedStorageFile.UsedSize

Perhatian

IsolatedStorageFile.CurrentSize has been deprecated because it is not CLS Compliant. To get the current size use IsolatedStorageFile.UsedSize instead.

Penting

API ini bukan kompatibel CLS.

Mendapatkan ukuran penyimpanan terisolasi saat ini.

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

Nilai Properti

Jumlah total byte penyimpanan yang saat ini digunakan dalam cakupan penyimpanan terisolasi.

Atribut

Pengecualian

Properti tidak tersedia. Penyimpanan saat ini memiliki cakupan roaming atau tidak terbuka.

Ukuran objek saat ini tidak ditentukan.

Contoh

Contoh kode berikut menunjukkan CurrentSize properti . Untuk konteks lengkap contoh ini, lihat IsolatedStorageFile gambaran umum.

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

Keterangan

Mewakili total penggunaan semua file dan direktori dalam cakupan penyimpanan yang terisolasi.

Ukuran saat ini tidak dapat ditentukan secara akurat untuk penyimpanan yang berpartisipasi dalam profil pengguna roaming. Karena profil roaming sering di-cache pada beberapa komputer klien dan kemudian disinkronkan dengan server, kuota tidak dapat diberlakukan untuk penyimpanan tersebut dan ukuran saat ini tidak dilaporkan.

Contoh Cara: Mengantisipasi Kondisi Di Luar Ruang dengan Penyimpanan Terisolasi menunjukkan penggunaan CurrentSize properti.

Berlaku untuk

Lihat juga