共用方式為


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

適用於