【发布时间】:2013-09-23 11:46:18
【问题描述】:
我有这个应用程序,我通过 PC 用户登录。我正在使用这个:
public static bool IsAuthenticated()
{
if (HttpContext.Current.User.Identity.IsAuthenticated)
{
CurrentUser = Factory.Users.List(item => item.Username.ToLower() == cToLower()).FirstOrDefault();
}
return CurrentUser != null;
}
注意:.List() 是我创建的用于列出所有数据库用户的方法(在 本例)。
一切正常。但是当我在我的 IIS 上发布我的网站时,HttpContext.Current.User.Identity.Name 什么也没有返回,根本没有用户。它有什么问题?有什么建议吗?
【问题讨论】:
-
你读过这个吗?这有帮助吗? stackoverflow.com/questions/1056487/…
标签: c#