62,050
社区成员
发帖
与我相关
我的任务
分享
WindowsIdentity userIdentity = WindowsIdentity.GetCurrent();
if (userIdentity != null)
{
WindowsPrincipal userPrincipal = new WindowsPrincipal(userIdentity);
Response.Write("------------- WindowsPrincipal ---------------</br>");
Response.Write(String.Format("User : {0} </br>",userPrincipal.Identity.Name));
Response.Write(String.Format("Authentication Mode : {0} </br>", userPrincipal.Identity.AuthenticationType));
Response.Write("</br></br>-------------- System.Web.UI.Page.User ------------------</br>");
Response.Write(String.Format("User : {0} </br>", User.Identity.Name));
Response.Write(String.Format("Authentication Mode : {0} </br>", User.Identity.AuthenticationType ));
Response.Write("</br></br>-------------- System.Web.HttpConterxt.User ------------------</br>");
Response.Write(String.Format("User : {0} </br>", Context.User.Identity.Name));
Response.Write(String.Format("Authentication Mode : {0} </br>", Context.User.Identity.AuthenticationType));
}