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
属性值
一个 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());
}
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈