.NET Framework Class Library
WebOperationContext..::.Current Property

Gets the current Web operation context.

Namespace:  System.ServiceModel.Web
Assembly:  System.ServiceModel.Web (in System.ServiceModel.Web.dll)
Syntax

Visual Basic (Declaration)
Public Shared ReadOnly Property Current As WebOperationContext
Visual Basic (Usage)
Dim value As WebOperationContext

value = WebOperationContext.Current
C#
public static WebOperationContext Current { get; }
Visual C++
public:
static property WebOperationContext^ Current {
    WebOperationContext^ get ();
}
JScript
public static function get Current () : WebOperationContext
Examples

The following code shows how to access the current WebOperationContext instance.

Visual Basic
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
C#
WebOperationContext current = WebOperationContext.Current;
WebHeaderCollection headers = current.IncomingRequest.Headers;

foreach (string name in headers)
{
    Console.WriteLine(name + " " + headers.Get(name));
}
Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5
See Also

Reference

Tags :


Page view tracker