我有一點麻煩與MVC HttpContext.User.Identity我得到system.security.principal.windowsIdentity,它給我我的Windows用戶名...我不希望這樣,我想要(首先)空User.Identity,所以我可以使用FormsAuthentication。我怎樣才能防止mvc使用這個system.security.principal.windowsIdentity來顯示正確的User.Identity?任何幫助,將不勝感激獲取正確的User.Identity
public ActionResult Index()
{
var s = HttpContext.User.Identity.Name; //
return View();
}
工作!謝謝 –