【发布时间】:2013-12-19 01:58:44
【问题描述】:
我找不到 User.Identity.Name 来自哪个参考程序集。我怎么知道呢?我需要将它添加到类库而不是我创建的默认 MVC 5 应用程序中以便我可以访问它吗?
http://msdn.microsoft.com/en-us/library/system.web.httpcontext.user(v=vs.110).aspx
C# 类库/AUser.cs
public class AUser
{
public string Username
{
get
{
return User.Identity.Name // doesn't notice User
}
}
}
【问题讨论】:
标签: c# windows-authentication visual-studio-2013 .net-assembly asp.net-mvc-5