ModuleService.Context 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得模組服務的管理內容。
public:
property Microsoft::Web::Management::Server::IManagementContext ^ Context { Microsoft::Web::Management::Server::IManagementContext ^ get(); };
public Microsoft.Web.Management.Server.IManagementContext Context { get; }
member this.Context : Microsoft.Web.Management.Server.IManagementContext
Public ReadOnly Property Context As IManagementContext
屬性值
範例
下列範例會 Context 使用 屬性來取得用戶端和目前使用者的相關資訊,然後將資訊寫入追蹤輸出。
public void TraceContext() {
Trace.WriteLine("Context.ClientClrVersion : " + Context.ClientClrVersion +
"\n IsLocalConnection " + Context.IsLocalConnection.ToString() +
"\n User.Identity.AuthenticationType " +
Context.User.Identity.AuthenticationType.ToString() +
"\n User.IsInRole(Administrator) " +
Context.User.IsInRole(WindowsBuiltInRole.Administrator.ToString()).ToString());
}