WebOperationContext.Current Propriété

Définition

Obtient le contexte d'opération Web actuel.

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

Valeur de propriété

Instance de WebOperationContext.

Exemples

Le code suivant indique comment accéder à l'instance WebOperationContext actuelle.

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

S’applique à