System 2.0.0.0 4.0.0.0 System.Object

Use to write an event log entry with a resource identifier rather than a string value. To write an event log entry, initialize the property and pass the instance to the method. The Event Viewer uses the instance identifier to find and display the corresponding string from the localized resource file based on current language settings. You must register the event source with the corresponding resource file before you write events using resource identifiers.

When writing events, you can set the property to specify the icon that the Event Viewer displays for the entry. You can also specify a property to specify the category that the Event Viewer displays for the entry.

The Event Viewer uses the category to filter events written by an event source. The Event Viewer can display the category as a numeric value, or it can use the category as a resource identifier to display a localized category string.

To display localized category strings in the Event Viewer, you must use an event source configured with a category resource file, and set the to a resource identifier in the category resource file. If the event source does not have a configured category resource file, or the specified does not index a string in the category resource file, and then the Event Viewer displays the numeric category value for that entry. Configure the category resource file, along with the number of category strings in the resource file, using the or the class.

You must register a source for an event log before using to write an event with the method. The source must be configured for writing localized entries to the log and the source must define at least a message resource file.

Create the new event source during the installation of your application. This allows time for the operating system to refresh its list of registered event sources and their configurations. If the operating system has not refreshed its list of event sources, and you attempt to write an event with the new source, the write operation will fail. You can configure a new source using an , or using the method. You must have administrative rights on the computer to create a new event source.

For details about defining event messages and building event log resource files, see the "Message Compiler" topic in the Platform SDK documentation at http://msdn.microsoft.com.

Represents language-neutral information for an event log entry.

- Constructor
  2.0.0.0
  4.0.0.0

  To write an informational entry to an event log, initialize an and pass it to the method. Set the to the resource identifier of the event message in the corresponding property for the source. Set the to a numeric category value, or the resource identifier of the event category in the property for the source; set the to zero for no event category. The property for the new instance is set to by default.

  The Event Viewer uses the resource identifiers to display the corresponding strings from the localized resource files for the source. You must register the source with the corresponding resource files before you can write events using resource identifiers.

  Initializes a new instance of the class using the specified resource identifiers for the localized message and category text of the event entry.

  A resource identifier that corresponds to a string defined in the message resource file of the event source.
  A resource identifier that corresponds to a string defined in the category resource file of the event source, or zero to specify no category for the event.
- Constructor
  2.0.0.0
  4.0.0.0

  To write an entry to an event log, initialize an and pass it to the method. Set the to the resource identifier of the event message in the corresponding property for the source. Set the to a numeric category value, or the resource identifier of the event category in the property for the source; set the to zero for no event category.

  The Event Viewer uses the resource identifiers to display the corresponding strings from the localized resource files for the source. You must register the source with the corresponding resource files before you can write events using resource identifiers.

  Set the to one of the pre-defined entry types. The Event Viewer uses the event type to determine which icon to display in the list view of the event log.

  Initializes a new instance of the class using the specified resource identifiers for the localized message and category text of the event entry and the specified event log entry type.

  A resource identifier that corresponds to a string defined in the message resource file of the event source.
  A resource identifier that corresponds to a string defined in the category resource file of the event source, or zero to specify no category for the event.
  An value that indicates the event type.
- Property
  2.0.0.0
  4.0.0.0
  System.Int32 To be added.

  Event log categories are application-defined values that help filter events, or provide further information about the event. For example, your application can define separate categories for different components or different operations.

  Set the property to specify the category that the Event Viewer displays for the entry. The Event Viewer can display the category as a numeric value, or it can use the as a resource identifier to display a localized category string based on the current language settings.

  To display localized category strings in the Event Viewer, you must use an event source configured with a category resource file, and set the to a resource identifier in the category resource file. If the event source does not have a configured category resource file, or the specified does not index a string in the category resource file, and then the Event Viewer displays the numeric category value for that entry.

  You must register the source with the corresponding resource file before you write event categories using resource identifiers. Configure the category resource file, along with the number of category strings in the resource file, using the or the class. When defining category strings in a resource file, the category resource identifiers must be numbered consecutively starting at 1, up to the configured property value.

  Event categories are optional. If your application does not use categories, do not set the for the event log entry.

  For details about defining event messages and building event resource files, see the "Message Compiler" topic in the Platform SDK documentation at http://msdn.microsoft.com. For details about defining event categories in resource files, see the "Event Categories" topic in the Platform SDK

  Gets or sets the resource identifier that specifies the application-defined category of the event entry.

- Property
  2.0.0.0
  4.0.0.0
  System.Diagnostics.EventLogEntryType To be added.

  Each event is of a single type, which the application indicates when it reports the event. The Event Viewer uses the event type to determine which icon to display in the list view of the event log.

  Gets or sets the event type of the event log entry.

- Property
  2.0.0.0
  4.0.0.0
  System.Int64 To be added.

  The property uniquely identifies an event entry for a configured event source. For events defined in message resource files, the corresponds to the resource identifier compiled from the message definition fields in the message text file. Your application can write localized event log entries by setting the to a resource identifier. The Event Viewer uses the resource identifier to find and display the corresponding string from the localized resource file based on current language settings. You must register the source with the corresponding resource file before you write events using resource identifiers.

  For details about defining event messages and building event log resource files, see the "Message Compiler" topic in the Platform SDK documentation at http://msdn.microsoft.com. For details about event log identifiers, see the "Event Identifiers" topic in the Platform SDK.

  Gets or sets the resource identifier that designates the message text of the event entry.