MemoryStream.Position MemoryStream.Position MemoryStream.Position MemoryStream.Position Property

定義

ストリームの現在位置を取得または設定します。Gets or sets the current position within the stream.

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

プロパティ値

ストリーム内の現在位置。The current position within the stream.

例外

位置が負の値または MaxValue より大きい値に設定されています。The position is set to a negative value or a value greater than MaxValue.

ストリームは閉じられています。The stream is closed.

このコード例が示されている例の一部、MemoryStreamクラス。This code example is part of a larger example provided for the MemoryStream class.

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

適用対象

こちらもご覧ください