ModuleService.Context 屬性

定義

取得模組服務的管理內容。

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

屬性值

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());
}

適用於