EventLogReader EventLogReader EventLogReader EventLogReader Class

定義

可讓您根據事件查詢來讀取事件記錄檔的事件。Enables you to read events from an event log based on an event query. 這個物件所讀取的事件會當做 EventRecord 物件傳回。The events that are read by this object are returned as EventRecord objects.

public ref class EventLogReader : IDisposable
public class EventLogReader : IDisposable
type EventLogReader = class
    interface IDisposable
Public Class EventLogReader
Implements IDisposable
繼承
EventLogReaderEventLogReaderEventLogReaderEventLogReader
實作

範例

例如程式碼使用這個類別中,請參閱How To:查詢事件How To:存取與讀取事件資訊For example code using this class, see How To: Query for Events or How To: Access and Read Event Information.

建構函式

EventLogReader(EventLogQuery) EventLogReader(EventLogQuery) EventLogReader(EventLogQuery) EventLogReader(EventLogQuery)

藉由指定事件查詢,初始化 EventLogReader 類別的新執行個體。Initializes a new instance of the EventLogReader class by specifying an event query.

EventLogReader(EventLogQuery, EventBookmark) EventLogReader(EventLogQuery, EventBookmark) EventLogReader(EventLogQuery, EventBookmark) EventLogReader(EventLogQuery, EventBookmark)

藉由指定事件查詢以及做為查詢開始位置的書籤,初始化 EventLogReader 類別的新執行個體。Initializes a new instance of the EventLogReader class by specifying an event query and a bookmark that is used as starting position for the query.

EventLogReader(String) EventLogReader(String) EventLogReader(String) EventLogReader(String)

藉由指定從中擷取事件的使用中事件記錄檔,初始化 EventLogReader 類別的新執行個體。Initializes a new instance of the EventLogReader class by specifying an active event log to retrieve events from.

EventLogReader(String, PathType) EventLogReader(String, PathType) EventLogReader(String, PathType) EventLogReader(String, PathType)

藉由指定從中擷取事件的事件記錄檔名稱或路徑,初始化 EventLogReader 類別的新執行個體。Initializes a new instance of the EventLogReader class by specifying the name of an event log to retrieve events from or the path to a log file to retrieve events from.

屬性

BatchSize BatchSize BatchSize BatchSize

取得或設定每個讀取作業從事件資料流中擷取的事件數目。Gets or sets the number of events retrieved from the stream of events on every read operation.

LogStatus LogStatus LogStatus LogStatus

取得這個物件中,與事件查詢相關聯之每個事件記錄或記錄檔的狀態。Gets the status of each event log or log file associated with the event query in this object.

方法

CancelReading() CancelReading() CancelReading() CancelReading()

取消目前的查詢作業。Cancels the current query operation.

Dispose() Dispose() Dispose() Dispose()

釋放這個物件所使用的所有資源。Releases all the resources used by this object.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

釋放這個物件所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by this object, and optionally releases the managed resources.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
ReadEvent() ReadEvent() ReadEvent() ReadEvent()

讀取從此物件之事件查詢傳回的下一個事件。Reads the next event that is returned from the event query in this object.

ReadEvent(TimeSpan) ReadEvent(TimeSpan) ReadEvent(TimeSpan) ReadEvent(TimeSpan)

讀取從此物件之事件查詢傳回的下一個事件。Reads the next event that is returned from the event query in this object.

Seek(EventBookmark) Seek(EventBookmark) Seek(EventBookmark) Seek(EventBookmark)

藉由指定書籤事件,變更事件資料流中所讀取之下一個事件的來源位置。Changes the position in the event stream where the next event that is read will come from by specifying a bookmark event. 在書籤事件之前所記錄的事件不會遭擷取。No events logged before the bookmark event will be retrieved.

Seek(EventBookmark, Int64) Seek(EventBookmark, Int64) Seek(EventBookmark, Int64) Seek(EventBookmark, Int64)

藉由指定書籤事件和從書籤的事件位移數目,變更事件資料流中所讀取之下一個事件的來源位置。Changes the position in the event stream where the next event that is read will come from by specifying a bookmark event and an offset number of events from the bookmark. 在書籤加上位移之前所記錄的事件不會遭擷取。No events logged before the bookmark plus the offset will be retrieved.

Seek(SeekOrigin, Int64) Seek(SeekOrigin, Int64) Seek(SeekOrigin, Int64) Seek(SeekOrigin, Int64)

藉由指定開始位置和從開始位置起算的位移,變更事件資料流中所讀取之下一個事件的來源位置。Changes the position in the event stream where the next event that is read will come from by specifying a starting position and an offset from the starting position. 在開始位置加上位移之前所記錄的事件不會遭擷取。No events logged before the starting position plus the offset will be retrieved.

ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

適用於

另請參閱