ASP.NET windows验证IIS配置

Windows验证时,需要配置IIS,把匿名验证设为disable,windows验证设为enable,window7 默认为匿名验证为enable,windows验证为disable。

否则会system.web.httpcontext.current.user is null, 这个值会是空的

具体设置方法如下:

  1. Open IIS Manager and navigate to the level you want to manage. For information about opening IIS Manager, see Open IIS Manager (IIS 7). For information about navigating to locations in the UI, see Navigation in IIS Manager (IIS 7).(打开IIS7并找到要设置的网站)

  2. In Features View, double-click Authentication.

  3. On the Authentication page, select Windows Authentication.

  4. In the Actions pane, click Enable to use Windows authentication

原文地址:https://www.cnblogs.com/zhengshuangliang/p/5000260.html