Teilen über


WebOperationContext.Current Eigenschaft

Definition

Ruft den Kontext des aktuellen Webvorgangs ab.

public:
 static property System::ServiceModel::Web::WebOperationContext ^ Current { System::ServiceModel::Web::WebOperationContext ^ get(); };
public static System.ServiceModel.Web.WebOperationContext Current { get; }
static member Current : System.ServiceModel.Web.WebOperationContext
Public Shared ReadOnly Property Current As WebOperationContext

Eigenschaftswert

Eine WebOperationContext-Instanz.

Beispiele

Im folgenden Code wird beschrieben, wie auf die aktuelle WebOperationContext-Instanz zugegriffen wird.

WebOperationContext current = WebOperationContext.Current;
WebHeaderCollection headers = current.IncomingRequest.Headers;

foreach (string name in headers)
{
    Console.WriteLine(name + " " + headers.Get(name));
}
Dim current As WebOperationContext = WebOperationContext.Current
Dim headers As WebHeaderCollection = current.IncomingRequest.Headers

For Each name As String In headers
    Console.WriteLine(name + " " + headers.Get(name))
Next

Gilt für: