MemoryStream.Position プロパティ

定義

ストリーム内の現在位置を取得または設定します。

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

プロパティ値

ストリーム内の現在の位置。

例外

この位置は、負の値または Int32.MaxValue より大きい値に設定されます。

ストリームが閉じられます。

このコード例は、 MemoryStream クラスに提供されるより大きな例の一部です。

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

適用対象

こちらもご覧ください