MemoryStream.Length Tulajdonság

Definíció

Bájtban lekéri a stream hosszát.

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

Tulajdonság értéke

A stream hossza bájtban.

Kivételek

A stream bezárult.

Példák

Ez a példakód egy nagyobb, az MemoryStream osztályhoz tartozó példa része.

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

A következőre érvényes:

Lásd még