MemoryStream.Position Tulajdonság

Definíció

Lekéri vagy beállítja az aktuális pozíciót a streamen belül.

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

Tulajdonság értéke

Az aktuális pozíció a streamen belül.

Kivételek

A pozíció értéke negatív vagy az Int32.MaxValue értéknél nagyobb.

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