System.Web.HttpContext.Current.User.Identity.Name
和System.Environment.UserName
在ASP.Net Web应用程序项目的上下文中有什么区别?
以下是我尝试实现的代码:
Database myDB = DatabaseFactory.CreateDatabase();
bool IsAuthUser = myDB.ExecuteScalar("procIsAuthorizedUser", System.Environment.UserName);
如果它们在功能上相同,从性能角度来看哪个更好?
这是一个基于C# 4.0/ASP.Net的Web应用程序,在组织内部会有适度使用。感谢您的回答。
username = HttpContext.Current.Request.LogonUserIdentity.Name.ToString().Split('\\')[1];
如何获取用户的显示名称? - SearchForKnowledge