MemoryStream.Position Propriété

Définition

Obtient ou définit la position actuelle dans le flux.

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

Valeur de propriété

Position actuelle dans le flux.

Exceptions

La position est définie sur une valeur négative ou une valeur supérieure à Int32.MaxValue.

Le flux est fermé.

Exemples

Cet exemple de code fait partie d’un exemple plus grand fourni pour la MemoryStream classe .

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

S’applique à

Voir aussi