MemoryStream.Position Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Property Value
The current position within the stream.
Exceptions
The position is set to a negative value or a value greater than Int32.MaxValue.
The stream is closed.
Examples
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())
Applies to
See also
التعاون معنا على GitHub
يمكن العثور على مصدر هذا المحتوى على GitHub حيث يمكنك أيضاً إضافة مشاكل وطلبات سحب ومراجعتها. للحصول على معلومات إضافية، اطلع على دليل المساهم لدينا.