简体   繁体   English

.NET返回不正确的用户名

[英].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.

相关问题 数据库返回的用户名检查不正确 - Database returning username check as incorrect ASP.NET MVC应用程序以错误的格式返回日期 - ASP.NET MVC app is returning dates in incorrect format .NET Calendar.GetWeekOfYear返回不正确的结果为en-US - .NET Calendar.GetWeekOfYear returning incorrect result for en-US DataReader为数据库表float列返回不正确的.net数据类型 - DataReader returning incorrect .net datatype for database table float column Lucene.Net 查询有两个 MUST 子句返回不正确的结果 - Lucene.Net Query with two MUST Clauses Returning Incorrect Results ASP.NET Web API中的个人帐户错误:用户名或密码不正确 - Individual Accounts in ASP.NET Web API error: username or password is incorrect SSH.net-SSH连接有效,但是SCP返回“错误的用户名和密码” - SSH.net - SSH connection works, but SCP returns “incorrect username and password” 基本身份验证的用户名和密码不正确 - Incorrect username and password with Basic Authentication Linq返回不正确的值 - Linq returning incorrect values ASP.Net Web API中的委托处理程序返回错误的状态代码 - Delegating Handler in ASP.Net Web API returning incorrect status code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM