WebRequestInformation.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.
Web isteği bilgilerini biçimlendirin.
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 Request Information:");
formatter.IndentationLevel += 1;
// Display the request information obtained
// using the WebRequestInformation object.
formatter.AppendLine(GetRequestPath());
formatter.AppendLine(GetRequestUrl());
formatter.AppendLine(GetRequestUserHostAdddress());
formatter.AppendLine(GetRequestPrincipal());
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 Request Information:")
formatter.IndentationLevel += 1
' Display the request information obtained
' using the WebRequestInformation object.
formatter.AppendLine(GetRequestPath())
formatter.AppendLine(GetRequestUrl())
formatter.AppendLine(GetRequestUserHostAdddress())
formatter.AppendLine(GetRequestPrincipal())
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ı gerekiyorsa yararlıdır. Sağlayıcı yöntemlerden birini ToString çağırdığında dahili olarak çağrılır.
Şunlara uygulanır
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin