怎么得到asp.net 得到客户端windows登录名

解决方案 »

  1.   

    System.Security.Principal.WindowsPrincipal p = System.Threading.Thread.CurrentPrincipal as System.Security.Principal.WindowsPrincipal;
    string strName = p.Identity.Name;
    string strName = HttpContext.Current.User.Identity.Name;
    string strName = Request.ServerVariables["AUTH_USER"];  
    iis启用匿名访问,则不会发送客户端登录名的,必须取得匿名访问,采用集成访问
      

  2.   

    Request.ServerVariables["LOGON_USER"].ToString();
    Request.ServerVariables["REMOTE_USER"].ToString();
    Request.ServerVariables["AUTH_USER"].ToString();