Bagikan melalui


MemoryStream.Length Properti

Definisi

Mendapatkan panjang aliran dalam byte.

public:
 virtual property long Length { long get(); };
public override long Length { get; }
member this.Length : int64
Public Overrides ReadOnly Property Length As Long

Nilai Properti

Panjang aliran dalam byte.

Pengecualian

Aliran ditutup.

Contoh

Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk MemoryStream kelas .

// Write the stream properties to the console.
Console::WriteLine( "Capacity = {0}, Length = {1}, "
"Position = {2}\n", memStream->Capacity.ToString(), memStream->Length.ToString(), memStream->Position.ToString() );
// Write the stream properties to the console.
Console.WriteLine(
    "Capacity = {0}, Length = {1}, Position = {2}\n",
    memStream.Capacity.ToString(),
    memStream.Length.ToString(),
    memStream.Position.ToString());
' Write the stream properties to the console.
Console.WriteLine( _
    "Capacity = {0}, Length = {1}, Position = {2}", _
    memStream.Capacity.ToString(), _
    memStream.Length.ToString(), _
    memStream.Position.ToString())

Berlaku untuk

Lihat juga