EventLogEntry.EventID 屬性

定義

警告

This property has been deprecated. Please use System.Diagnostics.EventLogEntry.InstanceId instead. http://go.microsoft.com/fwlink/?linkid=14202

警告

This property has been deprecated. Please use System.Diagnostics.EventLogEntry.InstanceId instead. https://go.microsoft.com/fwlink/?linkid=14202

警告

EventLogEntry.EventID has been deprecated. Use System.Diagnostics.EventLogEntry.InstanceId instead.

取得目前事件項目的應用程式特定事件識別項。

public:
 property int EventID { int get(); };
[System.Obsolete("This property has been deprecated.  Please use System.Diagnostics.EventLogEntry.InstanceId instead.  http://go.microsoft.com/fwlink/?linkid=14202")]
public int EventID { get; }
[System.Obsolete("This property has been deprecated.  Please use System.Diagnostics.EventLogEntry.InstanceId instead.  https://go.microsoft.com/fwlink/?linkid=14202")]
public int EventID { get; }
[System.Obsolete("EventLogEntry.EventID has been deprecated. Use System.Diagnostics.EventLogEntry.InstanceId instead.")]
public int EventID { get; }
public int EventID { get; }
[<System.Obsolete("This property has been deprecated.  Please use System.Diagnostics.EventLogEntry.InstanceId instead.  http://go.microsoft.com/fwlink/?linkid=14202")>]
member this.EventID : int
[<System.Obsolete("This property has been deprecated.  Please use System.Diagnostics.EventLogEntry.InstanceId instead.  https://go.microsoft.com/fwlink/?linkid=14202")>]
member this.EventID : int
[<System.Obsolete("EventLogEntry.EventID has been deprecated. Use System.Diagnostics.EventLogEntry.InstanceId instead.")>]
member this.EventID : int
member this.EventID : int
Public ReadOnly Property EventID As Integer

屬性值

事件訊息的應用程式特定識別項。

屬性

備註

這個值代表事件記錄檔中專案的事件標識符,前兩個位會遮罩關閉。 事件 InstanceId 記錄檔項目的 屬性代表事件來源之訊息資源檔中事件的完整 32 位資源識別符。 來自相同來源的兩個事件記錄檔專案可以有相符 EventID 的值,但因為事件標識碼前兩個位的差異而有不同的 InstanceId 值。

如果應用程式使用其中 WriteEntry 一種方法撰寫事件專案,則 EventID 屬性會符合選擇性 eventId 參數。 如果應用程式使用 WriteEvent 或 Windows API ReportEvent撰寫事件,則 EventID 屬性會比對事件的資源識別碼,並遮罩前兩個位。

適用於

另請參閱