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 属性将匹配事件的资源标识符,并屏蔽前两位。

适用于

另请参阅