通过域登录的代码:

<1>

System.Security.Principal.WindowsPrincipal p = System.Threading.Thread.CurrentPrincipal as System.Security.Principal.WindowsPrincipal;

string strName = p.Identity.Name;

<2>

string strName = HttpContext.Current.User.Identity.Name.ToString();

<3>

string strName = Request.ServerVariables["AUTH_USER"]; //Finding with name

string strName = Request.ServerVariables[5]; //Finding with index

posted on 2010-03-19 15:49  冰危节奏  阅读(209)  评论(0编辑  收藏  举报

导航