EventRecord 類別

定義

定義 (從 EventLogReader 物件接收的) 事件之事件執行個體的屬性。Defines the properties of an event instance for an event that is received from an EventLogReader object. 事件屬性可提供事件相關資訊,例如記錄事件所在的電腦名稱,以及事件的建立時間。The event properties provide information about the event such as the name of the computer where the event was logged and the time the event was created. 這個類別是抽象類別。This class is an abstract class. EventLogRecord 類別會實作這個類別。The EventLogRecord class implements this class.

public ref class EventRecord abstract : IDisposable
public abstract class EventRecord : IDisposable
type EventRecord = class
    interface IDisposable
Public MustInherit Class EventRecord
Implements IDisposable
繼承
EventRecord
衍生
實作

範例

如需使用此類別的範例程式代碼, 請參閱如何:查詢事件如何:存取和讀取事件資訊For example code using this class, see How To: Query for Events or How To: Access and Read Event Information.

建構函式

EventRecord()

初始化 EventRecord 類別的新執行個體。Initializes a new instance of the EventRecord class.

屬性

ActivityId

取得含有事件之執行中活動的全域唯一識別項 (GUID)。Gets the globally unique identifier (GUID) for the activity in process for which the event is involved. 這可以讓消費者將相關的活動分組。This allows consumers to group related activities.

Bookmark

取得對應至這個事件的預留位置 (書籤)。Gets a placeholder (bookmark) that corresponds to this event. 它可以當做事件之資料流中的預留位置使用。This can be used as a placeholder in a stream of events.

Id

取得這個事件的識別項。Gets the identifier for this event. 所有具有這個識別項值的事件都表示相同的事件型別。All events with this identifier value represent the same type of event.

Keywords

取得事件的關鍵字遮罩。Gets the keyword mask of the event. 取得 KeywordsDisplayNames 屬性的值,以取得這個遮罩中所使用之關鍵字的名稱。Get the value of the KeywordsDisplayNames property to get the name of the keywords used in this mask.

KeywordsDisplayNames

取得此事件的關鍵字遮罩中所使用之關鍵字的顯示名稱。Gets the display names of the keywords used in the keyword mask for this event.

Level

取得事件的等級。Gets the level of the event. 這個等級表示事件的嚴重性。The level signifies the severity of the event. 如需等級名稱,請取得 LevelDisplayName 屬性的值。For the name of the level, get the value of the LevelDisplayName property.

LevelDisplayName

取得這個事件等級的顯示名稱。Gets the display name of the level for this event.

LogName

取得記錄這個事件的事件記錄檔名稱。Gets the name of the event log where this event is logged.

MachineName

取得記錄這個事件的電腦名稱。Gets the name of the computer on which this event was logged.

Opcode

取得事件的 opcode。Gets the opcode of the event. 這個 opcode 會定義數值,這個數值會定義活動 (當應用程式引發事件時,會執行這個活動) 或活動中的某一點。The opcode defines a numeric value that identifies the activity or a point within an activity that the application was performing when it raised the event. 如需 opcode 名稱,請取得 OpcodeDisplayName 屬性的值。For the name of the opcode, get the value of the OpcodeDisplayName property.

OpcodeDisplayName

取得這個事件之 opcode 的顯示名稱。Gets the display name of the opcode for this event.

ProcessId

取得記錄這個事件之事件提供者的處理序識別項。Gets the process identifier for the event provider that logged this event.

Properties

取得事件的使用者提供屬性。Gets the user-supplied properties of the event.

ProviderId

取得發行這個事件之事件提供者的全域唯一識別項 (GUID)。Gets the globally unique identifier (GUID) of the event provider that published this event.

ProviderName

取得發行這個事件之事件提供者的名稱。Gets the name of the event provider that published this event.

Qualifiers

取得用於事件識別的限定詞編號。Gets qualifier numbers that are used for event identification.

RecordId

取得記錄檔中事件的事件記錄識別項。Gets the event record identifier of the event in the log.

RelatedActivityId

取得含有事件之執行中相關活動的全域唯一識別項 (GUID)。Gets a globally unique identifier (GUID) for a related activity in a process for which an event is involved.

Task

取得發行事件之應用程式或元件一部分的工作識別項。Gets a task identifier for a portion of an application or a component that publishes an event. 工作是已保留 16 個臨界數值的 16 位元值。A task is a 16-bit value with 16 top values reserved. 這個型別允許介於使用 0x0000 和 0xffef 之間的任何值。This type allows any value between 0x0000 and 0xffef to be used. 若要取得 (Obtain) 工作名稱,請取得 (Get) TaskDisplayName 屬性的值。To obtain the task name, get the value of the TaskDisplayName property.

TaskDisplayName

取得事件之工作的顯示名稱。Gets the display name of the task for the event.

ThreadId

取得事件提供者執行所在執行緒的執行緒識別項。Gets the thread identifier for the thread that the event provider is running in.

TimeCreated

取得事件的建立時間,格示為 DateTimeGets the time, in DateTime format, that the event was created.

UserId

取得使用者的安全性描述元,這位使用者的內容會用來發行事件。Gets the security descriptor of the user whose context is used to publish the event.

Version

取得事件的版本號碼。Gets the version number for the event.

方法

Dispose()

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

Dispose(Boolean)

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

Equals(Object)

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

(繼承來源 Object)
FormatDescription()

取得目前地區設定的事件訊息。Gets the event message in the current locale.

FormatDescription(IEnumerable<Object>)

取得事件訊息,並將訊息中的變數取代為指定的值。Gets the event message, replacing variables in the message with the specified values.

GetHashCode()

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

(繼承來源 Object)
GetType()

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

(繼承來源 Object)
MemberwiseClone()

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

(繼承來源 Object)
ToString()

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

(繼承來源 Object)
ToXml()

取得事件的 XML 表示。Gets the XML representation of the event. 所有事件屬性都是以事件的 XML 來表示。All of the event properties are represented in the event XML. XML 符合事件結構描述The XML conforms to the event schema.

適用於

另請參閱