Export (0) Print
Expand All

WebThreadInformation.IsImpersonating Property

Gets the current thread-impersonation mode.

Namespace:  System.Web.Management
Assembly:  System.Web (in System.Web.dll)

public bool IsImpersonating { get; }

Property Value

Type: System.Boolean
true if the thread is executing in impersonation mode; otherwise, false.

The following code example shows how to get the thread-impersonation mode.

// Get the impersonation mode. 
public string GetThreadImpersonation()
{
    return (string.Format(
        "Is impersonating: {0}",
        ThreadInformation.IsImpersonating.ToString()));
}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
Show:
© 2015 Microsoft