使用Windows身份验证获取Windows用户名
问题描述:
使用Windows身份验证获取Windows用户名??? ..............
Getting windows username using windows authentication???..............
答
将应用程序配置为使用Windows身份验证,然后只需使用这段代码即可获取Windows域\用户名:
Once you have configured your app to use windows authentication, then just use this piece of code to get the Windows domain\username:
HttpContext.Current.User.Identity.Name