MemoryStream.Position Właściwość

Definicja

Pobiera lub ustawia bieżącą pozycję w strumieniu.

public:
 virtual property long Position { long get(); void set(long value); };
public override long Position { get; set; }
member this.Position : int64 with get, set
Public Overrides Property Position As Long

Wartość właściwości

Bieżąca pozycja w strumieniu.

Wyjątki

Pozycja jest ustawiona na wartość ujemną lub wartość większą niż Int32.MaxValue.

Strumień jest zamknięty.

Przykłady

Ten przykład kodu jest częścią większego przykładu podanego MemoryStream dla klasy.

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

Dotyczy

Zobacz też