返回首页

您好所有,

我工作的Web应用程序,该网站是在2003年的窗口服务器托管,我们有一定的要求,每当用户尝试登录到该网站,我们应该能够捕获来自系统或电脑(视窗XP)的用户名{ BR} 我已经尝试用下面的所有语法:

1) string a;

        a = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();

        Response.Write(a.ToString());

 

       2) //System.Security.Principal.WindowsPrincipal wp = new

        //System.Security.Principal.WindowsPrincipal

        //(System.Security.Principal.WindowsIdentity.GetCurrent());

        //Response.Write(wp.Identity.Name);



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

        //string strName = p.Identity.Name;



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

        //strName = Request.ServerVariables[5];

        //Response.Write(strName.ToString());



      4) // Response.Write(System.Environment.UserName.ToString());

以上所有的语法displayin从网站服务器托管的用户名,但我想捕捉从用户机器上的用户名

任何一个可以帮助我吗?

谢谢你在前进

[编辑]代码被包裹在"前"的标签[/编辑]| Roancho汗

回答

评论会员:游客 时间:2012/02/06
你不能得到用户的身份-他的浏览器出于安全原因,保护客户端的背后
SAKryukov
评论会员:Roancho汗写道::| 时间:2012/02/06