WebProcessInformation.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

Web の状態イベント情報の書式設定に使用するタブとインデントの設定を格納している WebEventFormatter

次の例は、カスタム情報の書式を設定する方法を示しています。

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

    // Add custom data.
    formatter.AppendLine("Custom Process Information:");
    formatter.IndentationLevel += 1;

    // Display the process information.
    formatter.AppendLine(GetAccountName());
    formatter.AppendLine(GetProcessId());
    formatter.AppendLine(GetProcessName());
    formatter.IndentationLevel -= 1;
    formatter.AppendLine(eventInfo.ToString());
}
 'Formats Web request event information.
 Public Overrides Sub FormatCustomEventDetails( _
 ByVal formatter _
 As System.Web.Management.WebEventFormatter)
     MyBase.FormatCustomEventDetails(formatter)

     ' Add custom data.
     formatter.AppendLine("")
     formatter.AppendLine( _
     "Custom Process Information:")
     formatter.IndentationLevel += 1

     ' Display the process information.
     formatter.AppendLine(GetAccountName())
     formatter.AppendLine(GetProcessId())
     formatter.AppendLine(GetProcessName())
     formatter.IndentationLevel -= 1
     formatter.AppendLine(eventInfo.ToString())
 End Sub

注釈

メソッドは FormatToString 、イベント情報の均一な形式を提供します。これは、イベント データをログに記録し、後でユーザーに提示する必要がある場合に便利です。 メソッドは、プロバイダーがいずれかのメソッドを呼び出すときに内部的に ToString 呼び出されます。

適用対象