System.Diagnostics.EventLog.RegisterDisplayName Method

Specifies the localized name of the event log, which is displayed in the server Event Viewer.

Syntax

[System.MonoTODO]
[System.Runtime.InteropServices.ComVisible(false)]
public void RegisterDisplayName (string resourceFile, long resourceId)

Parameters

resourceFile
The fully specified path to a localized resource file.
resourceId
The resource identifier that indexes a localized string within the resource file.

Remarks

Use EventLog.RegisterDisplayName(string, long) to register and display a localized name in the Event Viewer for custom event logs.

The specified resource identifier must correspond to a localized string defined in the resource file. The Event Viewer displays the custom event log name using the localized string and the current culture settings. For example, you can define multiple event log names localized for different cultures in your resource file. The Event Viewer displays the localized string corresponding to the culture settings of the current user.

If the Event Viewer cannot load the localized string from the resource file, or if no display name was registered for the event log, then the Event Viewer displays the event log name defined in EventLog.Log.

Note:

You do not need to register a display name for the pre-defined event logs. The operating system registers the localized display names for the Application, System, and Security event logs.

Requirements

Namespace: System.Diagnostics
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0