WebProcessInformation.FormatToString メソッド
アセンブリ: System.Web (system.web.dll 内)
 構文
構文Dim instance As WebProcessInformation Dim formatter As WebEventFormatter instance.FormatToString(formatter)
 解説
解説FormatToString メソッドを使用すると、イベント情報の形式を統一できます。イベント データのログを記録しておき、後でユーザーに提示する場合に有用です。このメソッドは、プロバイダが 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
//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()); }
 プラットフォーム
プラットフォームWindows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
 バージョン情報
バージョン情報 参照
参照- WebProcessInformation.FormatToString メソッドのページへのリンク

 
                             
                    


