WebThreadInformation.FormatToString(WebEventFormatter) 메서드

정의

스레드 관련 정보의 형식을 지정합니다.

public:
 void FormatToString(System::Web::Management::WebEventFormatter ^ formatter);
public void FormatToString(System.Web.Management.WebEventFormatter formatter);
member this.FormatToString : System.Web.Management.WebEventFormatter -> unit
Public Sub FormatToString (formatter As WebEventFormatter)

매개 변수

formatter
WebEventFormatter

WebEventFormatter 웹 상태 이벤트 정보의 서식을 지정하는 데 사용되는 탭 및 들여쓰기 설정이 들어 있는 항목입니다.

예제

다음 코드 예제에서는 사용자 지정 정보의 서식을 지정하는 방법을 보여줍니다.


// Formats Web request event information.
public override void FormatCustomEventDetails(
 WebEventFormatter formatter)
{

    // Add custom data.

    formatter.AppendLine("");
    formatter.AppendLine(
        "Custom Thread Information:");

    formatter.IndentationLevel += 1;

    // Display the thread information obtained 
    formatter.AppendLine(GetThreadImpersonation());
    formatter.AppendLine(GetThreadStackTrace());
    formatter.AppendLine(GetThreadAccountName());
    formatter.AppendLine(GetThreadId());
    formatter.IndentationLevel -= 1;

    formatter.AppendLine(eventInfo.ToString());
}
' Formats Web request event information.
 Public Overrides Sub FormatCustomEventDetails( _
 ByVal formatter As WebEventFormatter)

     ' Add custom data.
     formatter.AppendLine("")
     formatter.AppendLine( _
     "Custom Thread Information:")

     formatter.IndentationLevel += 1

     ' Display the thread information obtained 
     formatter.AppendLine(GetThreadImpersonation())
     formatter.AppendLine(GetThreadStackTrace())
     formatter.AppendLine(GetThreadAccountName())
     formatter.AppendLine(GetThreadId())
     formatter.IndentationLevel -= 1

     formatter.AppendLine(eventInfo.ToString())
 End Sub

설명

이 메서드는 FormatToString 이벤트 정보에 대한 균일한 형식을 제공합니다. 이 형식은 이벤트 데이터를 기록해야 하고 나중에 사용자에게 제공해야 하는 경우에 유용합니다. 공급자가 메서드 중 ToString 하나를 호출할 때 내부적으로 호출됩니다.

적용 대상