LogRecordSequence.BaseSequenceNumber 属性

定义

获取当前 LogRecordSequence 中第一条有效记录的序列号。

public:
 property System::IO::Log::SequenceNumber BaseSequenceNumber { System::IO::Log::SequenceNumber get(); };
public System.IO.Log.SequenceNumber BaseSequenceNumber { get; }
member this.BaseSequenceNumber : System.IO.Log.SequenceNumber
Public ReadOnly Property BaseSequenceNumber As SequenceNumber

属性值

LogRecordSequence 中的有效记录对应的最低序列号。

实现

例外

该属性是在序列已释放之后访问的。

示例

此示例演示如何在循环中使用 BaseSequenceNumber 成员。

foreach (LogRecord record in sequence1.ReadLogRecords(sequence1.BaseSequenceNumber, LogRecordEnumeratorType.Next))
{
    byte[] data = new byte[record.Data.Length];
    record.Data.Read(data, 0, (int)record.Data.Length);
    string mystr = enc.GetString(data);
    Console.WriteLine("    {0}", mystr);
}
For Each record In sequence1.ReadLogRecords(sequence1.BaseSequenceNumber, LogRecordEnumeratorType.Next)
    Dim data(record.Data.Length - 1) As Byte
    record.Data.Read(data, 0, CInt(Fix(record.Data.Length)))
    Dim mystr As String = enc.GetString(data)
    Console.WriteLine("    {0}", mystr)
Next record

注解

有效序列号大于或等于 BaseSequenceNumber 且小于 LastSequenceNumber

可通过调用 WriteRestartArea 方法或 AdvanceBaseSequenceNumber 方法来更改此属性的值。

适用于