EventLogEntry.ReplacementStrings 속성

정의

이벤트 로그 엔트리와 연결된 대체 문자열을 가져옵니다.

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()

속성 값

String[]

이벤트 엔트리에 저장된 대체 문자열을 포함하는 배열입니다.

설명

이 속성은 항목의 대체 문자열만 검색합니다. 전체 메시지를 검색하려면 속성을 읽습니다 Message .

속성에는 ReplacementStrings 이벤트 로그 항목에 사용되는 대체 문자열의 지역화된 버전이 포함되어 있습니다. 애플리케이션에 대 한 각 대상 언어의 문자열이 포함 된 리소스 파일을 제공 하는 경우 해당 컴퓨터에 사용 되는 언어에서 이벤트 로그 메시지를 내보낼 수 있습니다. 이렇게 하려면 대체 문자열을 포함하는 리소스 어셈블리에 대한 클래스의 ResourceManager instance 만듭니다. 생성자의 첫 번째 매개 변수 ResourceManager(String, Assembly) 는 사용할 리소스 어셈블리를 식별합니다. GetString 해당 instance 메서드를 사용하여 로그 이벤트에 대해 지역화된 메시지를 제공할 수 있습니다. 다음 코드는 메시지를 현재 문화권의 언어로 자동으로 설정합니다.

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);  

적용 대상

추가 정보