EventLogEntry.EventID Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Note: This API is now obsolete.

Gets the application-specific event identifier for the current event entry.

Namespace:   System.Diagnostics
Assembly:  System (in System.dll)

[ObsoleteAttribute("This property has been deprecated.  Please use System.Diagnostics.EventLogEntry.InstanceId instead.  http://go.microsoft.com/fwlink/?linkid=14202")]
public int EventID { get; }

Property Value

Type: System.Int32

The application-specific identifier for the event message.

This value represents the event identifier for the entry in the event log, with the top two bits masked off. The InstanceId property for an event log entry represents the full 32-bit resource identifier for the event in the message resource file for the event source. Two event log entries from the same source can have matching EventID values, but have different InstanceId values due to differences in the top two bits of the event identifier.

If the application wrote the event entry using one of the WriteEntry methods, the EventID property matches the optional eventId parameter. If the application wrote the event using WriteEvent or the Win32 API ReportEvent, the EventID property matches the resource identifier for the event, with the top two bits masked off.

.NET Framework
Available since 1.1
Return to top