ASP.NET windows验证IIS配置

时间:2024-09-17 13:36:26

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

ASP.NET windows验证IIS配置