Aracılığıyla paylaş


WebRequestEvent Oluşturucular

Tanım

WebRequestEvent sınıfının yeni bir örneğini başlatır.

Aşırı Yüklemeler

WebRequestEvent(String, Object, Int32)

WebRequestEvent Sınıfı belirtilen olay parametreleriyle başlatır.

WebRequestEvent(String, Object, Int32, Int32)

WebRequestEvent Sınıfı belirtilen olay parametreleriyle başlatır.

WebRequestEvent(String, Object, Int32)

WebRequestEvent Sınıfı belirtilen olay parametreleriyle başlatır.

protected public:
 WebRequestEvent(System::String ^ message, System::Object ^ eventSource, int eventCode);
protected internal WebRequestEvent (string message, object eventSource, int eventCode);
new System.Web.Management.WebRequestEvent : string * obj * int -> System.Web.Management.WebRequestEvent
Protected Friend Sub New (message As String, eventSource As Object, eventCode As Integer)

Parametreler

message
String

Olayla ilişkili ileti.

eventSource
Object

Olayın kaynağı olan nesne.

eventCode
Int32

Olayla WebEventCodes ilişkili kod. değerinden büyük WebExtendedBaseolmalıdır.

Örnekler

Aşağıdaki kod örneğinde bu oluşturucunun nasıl özelleştirileceği gösterilmektedir.

Not

Olay kodunuzu veya tanımlayıcınızı tanımlamak için kullandığınız değer değerinden WebExtendedBasebüyük olmalıdır.

// Invoked in case of events identified only 
// by their event code.
public SampleWebRequestEvent(
    string msg, 
    object eventSource, int eventCode): 
    base(msg, eventSource, eventCode)
{
   
    // Perform custom initialization.
    customCreatedMsg =
      string.Format(
      "Event created at: {0}", 
      EventTime.ToString());
}
' Invoked in case of events identified only 
' by their event code.
Public Sub New(ByVal msg As String, _
ByVal eventSource As Object, _
ByVal eventCode As Integer)
    MyBase.New(msg, eventSource, eventCode)

    ' Perform custom initialization.
    customCreatedMsg = String.Format( _
    "Event created at: {0}", _
    EventTime.ToString())

End Sub

Açıklamalar

Oluşturucu WebRequestEvent , olay iletisini, olayın kaynağını ve olayla ilişkili kodu veya tanımlayıcıyı belirtmeye olanak tanır.

Şunlara uygulanır

WebRequestEvent(String, Object, Int32, Int32)

WebRequestEvent Sınıfı belirtilen olay parametreleriyle başlatır.

protected public:
 WebRequestEvent(System::String ^ message, System::Object ^ eventSource, int eventCode, int eventDetailCode);
protected internal WebRequestEvent (string message, object eventSource, int eventCode, int eventDetailCode);
new System.Web.Management.WebRequestEvent : string * obj * int * int -> System.Web.Management.WebRequestEvent
Protected Friend Sub New (message As String, eventSource As Object, eventCode As Integer, eventDetailCode As Integer)

Parametreler

message
String

Olayla ilişkili ileti.

eventSource
Object

Olayın kaynağı olan nesne.

eventCode
Int32

Olayla WebEventCodes ilişkili kod. değerinden büyük WebExtendedBaseolmalıdır.

eventDetailCode
Int32

Olayla WebEventCodes ilişkili ayrıntı kodu.

Örnekler

Aşağıdaki kod örneğinde bu oluşturucunun nasıl özelleştirileceği gösterilmektedir.

Not

Olay kodunuzu veya tanımlayıcınızı tanımlamak için kullandığınız değer WebExtendedBase

// Invoked in case of events identified 
// by their event code.and 
// related event detailed code.
public SampleWebRequestEvent(string msg,
    object eventSource, int eventCode,
    int eventDetailCode):
    base(msg, eventSource, eventCode, 
    eventDetailCode)
{
    // Perform custom initialization.
    customCreatedMsg =
      string.Format(
      "Event created at: {0}", 
      EventTime.ToString());
}
' Invoked in case of events identified 
' by their event code.and 
' related event detailed code.
Public Sub New(ByVal msg As String, _
ByVal eventSource As Object, _
ByVal eventCode As Integer, _
ByVal eventDetailCode As Integer)
    MyBase.New(msg, eventSource, _
    eventCode, eventDetailCode)
    ' Perform custom initialization.
    customCreatedMsg = String.Format( _
    "Event created at: {0}", _
    EventTime.ToString())

End Sub

Açıklamalar

Oluşturucu WebRequestEvent , olay iletisinin, olayın kaynağının, olayla ilişkili kodun veya tanımlayıcının ve ayrıntılı kodun belirtilmesine olanak tanır.

Şunlara uygulanır