【发布时间】:2016-07-14 15:48:48
【问题描述】:
即使使用运行方式,我也必须在我的应用程序中读取用户日志,并且在 windows server 2012 的域中创建的名称有 23 个字符, 我用过:
Environment.UserName
new System.Security.Principal.WindowsPrincipal(System.Security.Principal.WindowsIdentity.GetCurrent()).Identity.Name;
System.Security.Principal.WindowsIdentity.GetCurrent().Name
但是这一切都给了我没有最后 3 个字符的名字 我用过:
UserPrincipal.Current.UserPrincipalName
UserPrincipal.Current.Name
但是给我显示的名字
如何获取完整的登录名
【问题讨论】: