EventLogEntry.ReplacementStrings Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the replacement strings associated with the event log entry.
public:
property cli::array <System::String ^> ^ ReplacementStrings { cli::array <System::String ^> ^ get(); };
public string[] ReplacementStrings { get; }
member this.ReplacementStrings : string[]
Public ReadOnly Property ReplacementStrings As String()
Property Value
An array that holds the replacement strings stored in the event entry.
Remarks
This property retrieves only the replacement strings for the entry. To retrieve the full message, read the Message property.
The ReplacementStrings property contains the localized versions of replacement strings that are used in the event log entry. If you provide resource files that contain strings in each target language for your application, you can emit event log messages in the language that is used on that computer. To do that, create an instance of the ResourceManager class for the resource assembly that contains your replacement strings. The first parameter of the ResourceManager(String, Assembly) constructor identifies the resource assembly to be used. Use the GetString method of that instance to supply localized messages for log events. The following code automatically sets the message to the language for the current culture.
ResourceManager LocRM = new ResourceManager("ReplacementStrings.TestStrings",
typeof(Program).Assembly);
EventLog e1 = new EventLog("LocTest", "MyMachine", "LocTest");
// Get the string associated with the current culture.
e1.WriteEntry(LocRM.GetString("strMessage"),
EventLogEntryType.Information);
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기