C#
HttpContext.Current.User.Identity.Name;

得到结果:域\admin

1.在IIS中将访问方式更改为不允许匿名访问

2.在Web.config中将验证方式更改为
               <identity impersonate="true"/>
               <authentication mode="Windows" />

3.在源代码中使用
   var1 = Security.Principal.WindowsIdentity.GetCurrent.Name

===========================================
HttpContext.Current.User.Identity.Name

posted on 2008-02-25 15:30  晃晃悠悠  阅读(472)  评论(0)    收藏  举报