MemoryStream.Length 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會取得串流長度(以位元組為單位)。
public:
virtual property long Length { long get(); };
public override long Length { get; }
member this.Length : int64
Public Overrides ReadOnly Property Length As Long
屬性值
串流長度以位元組為單位。
例外狀況
溪流已經關閉。
範例
此程式碼範例是本類別更大範例 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())