请各位~详解~ 谢谢!
这是返回一个通过身份验证的用户名~
HttpContext.Current.User.Identity.Name 请问此属性到底是怎么获取用户名的?
C#测试结果是这样的:
一个注册新用户WEB窗体,窗体成员 txtUserid, txtlogin, txtpassword,bntaccept .  
DataBase:sqlserver    Table:  Usertab 字段:userid,login,password 为char(50).
通过butaccept click 事件
把窗体成员的值插入数据库;
txtUserid=Guid.newGuid.tostring();//全局唯-标识
txtlogin="name";
txtpassword="pwd";
下一个用户登陆WEB窗体,窗体成员txtname ,txtpassword,bntEnter,输入用户名:nema 密码:pwd   单击bntEnter时到数据库查找一下,找到对应的用户名,和密码是返回 userid。 利用方法FormsAuthentication.RedirectFromLoginPage(userid ,false)跳到这个用户最初访问的页面;
这时显示HttpContext.Current.User.Identity.Name 返回值,就是全局唯-标识 =userid;