[英].NET returning incorrect username
I made a spelling mistake when I created an account a few weeks back. 几周前创建一个帐户时,我犯了一个拼写错误。 I changed the account and they can log onto the domain with the new name. 我更改了帐户,他们可以使用新名称登录域。 However we have a web application in house that is still picking up the wrong name. 但是,我们内部有一个Web应用程序仍在选择错误的名称。
The .net application uses .net应用程序使用
System.Security.Principal.WindowsIdentity.GetCurrent().Name;
Which gives the old name. 这给出了旧名称。
If I use 如果我用
Environment.UserName
I get the correct new name. 我得到正确的新名字。 What did I miss in the AD? 我在广告中错过了什么? Is there somewhere I can change the name which will result in System.Security.Principal.WindowsIdentity.GetCurrent().Name; 有什么地方可以更改名称,该名称将导致System.Security.Principal.WindowsIdentity.GetCurrent()。Name; giving the correct name? 给出正确的名字?
I have no experience with .net so I'm very sorry if the question has an obvious answer. 我没有使用.net的经验,所以很抱歉,如果这个问题有明显的答案。
Check out here for the Answer: 在这里查看答案:
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/27e42d4a-6452-4840-bbf2-abbc16e22557 http://social.msdn.microsoft.com/Forums/zh-CN/csharpgeneral/thread/27e42d4a-6452-4840-bbf2-abbc16e22557
Add the Key: 添加密钥:
"HKLM/System/CurrentControlSet/Control/Lsa/LsaLookupCacheMaxSize=0" “ HKLM /系统/ CurrentControlSet /控件/ Lsa / LsaLookupCacheMaxSize = 0”
To your registry as this is cached. 缓存到您的注册表。 I don't think restarting IIS will fix this issue. 我认为重新启动IIS不会解决此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.