WebThreadInformation.FormatToString(WebEventFormatter) Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
İş parçacığıyla ilgili bilgileri biçimlendirır.
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)
Parametreler
- formatter
- WebEventFormatter
WebEventFormatter Web sistem durumu olay bilgilerini biçimlendirmek için kullanılan sekme ve girinti ayarlarını içeren.
Örnekler
Aşağıdaki kod örneğinde özel bilgilerin nasıl biçimlendirilir gösterilmektedir.
// 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
Açıklamalar
yöntemi, FormatToString olay bilgileri için tekdüzen bir biçim sağlar. Bu biçim, olay verilerinin günlüğe kaydedilmesi ve daha sonra kullanıcıya sunulması gerektiğinde yararlıdır. Sağlayıcı yöntemlerden birini ToString çağırdığında dahili olarak çağrılır.