WebThreadInformation.IsImpersonating 属性

定义

获取当前的线程模拟模式。

public:
 property bool IsImpersonating { bool get(); };
public bool IsImpersonating { get; }
member this.IsImpersonating : bool
Public ReadOnly Property IsImpersonating As Boolean

属性值

Boolean

如果线程在模拟模式下执行,则为 true;否则为 false

示例

下面的代码示例演示如何获取线程模拟模式。

// Get the impersonation mode.
public string GetThreadImpersonation()
{
    return (string.Format(
        "Is impersonating: {0}",
        ThreadInformation.IsImpersonating.ToString()));
}
' Get the impersonation mode.
Public Function GetThreadImpersonation() As String
     Return String.Format( _
     "Is impersonating: {0}", _
     ThreadInformation.IsImpersonating.ToString())
End Function 'GetThreadImpersonation

适用于