.net WCF netTcpBinding获取用户名
我有一个使用netTcpBinding的自托管WCF服务。是否有一个类可用于访问调用服务的客户端的域用户名。我试图查看.net WCF netTcpBinding获取用户名,.net,wcf,.net,Wcf,我有一个使用netTcpBinding的自托管WCF服务。是否有一个类可用于访问调用服务的客户端的域用户名。我试图查看操作上下文,但没有找到答案。谢谢试试这个: ServiceSecurityContext serviceSecurityContext = ServiceSecurityContext.Current; if (serviceSecurityContext != null) { string accountText = serviceSecurityContext.Windo
操作上下文
,但没有找到答案。谢谢试试这个:
ServiceSecurityContext serviceSecurityContext = ServiceSecurityContext.Current;
if (serviceSecurityContext != null)
{
string accountText = serviceSecurityContext.WindowsIdentity.Name;
}
WindowsIdentity属性包含大量有关用户的信息。请尝试以下操作:
ServiceSecurityContext serviceSecurityContext = ServiceSecurityContext.Current;
if (serviceSecurityContext != null)
{
string accountText = serviceSecurityContext.WindowsIdentity.Name;
}
WindowsIdentity属性包含大量有关用户的信息。谢谢,这是我一直在寻找的Hanks,这是我一直在寻找的