博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

web.config in asp.net 2.0 application

Posted on 2007-03-29 00:15  Snapping  阅读(190)  评论(0编辑  收藏  举报

<system.web>
        <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
        -->
        <compilation debug="true" />
        <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
      <authentication mode="Windows" /> <!--指定身份验证方式-->
      <authorization><!--配置整个网站的访问权限-->
        <allow users="*"/>
      </authorization>

      <customErrors mode="On"   defaultRedirect="Error.aspx"> <!--页面出现错误时redirect到的页面-->
        <error statusCode="403" redirect="NoAccess.aspx" />
        <error statusCode="404" redirect="FileNotFound.aspx" />
      </customErrors>
  </system.web>
  <location path="Default.aspx"><!--限制页面的访问权限-->
    <system.web>
      <authorization>
        <deny users="*"/>
      </authorization>
    </system.web>
  </location>
  <location path="aa">  <!--限制文件夹的访问权限-->
    <system.web>
      <authorization>
        <deny users="*"/>
      </authorization>
    </system.web>
  </location>