webConfig对访问者的权限设置

<configuration>
    <system.web>
        <compilation debug="true" targetFramework="4.0" />
      <authentication mode="Forms">
        <forms loginUrl="WebLogin.aspx" defaultUrl="Index.aspx"/>
      </authentication>
      <authorization>
        <!---拒绝所有匿名用户访问项目下的所有文件-->
        <deny users="?"/>
<!--设置所有用户都可以访问项目下的所有文件-->
        <!--<allow users="*"/>-->
      </authorization>
    </system.web>
   <!--设置非匿名用户可以访问项目下的文件路径-->
  <location path="admin">
    <system.web>
      <authorization>
        <deny users="?"/>
      </authorization>
    </system.web>
  </location>
 
</configuration>

posted @ 2013-06-14 08:54  奇奇博客  阅读(217)  评论(0编辑  收藏  举报