IsImpersonating Property
Collapse the table of content
Expand the table of content

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
Available since 2.0
Return to top
Show:
© 2016 Microsoft