只让匿名用户访问 首页,注册页面 还有登陆页面。。
                                                 配置文件里面怎么写?只要授权的代码就行了。。

解决方案 »

  1.   

    将首页,注册页面 还有登陆页面(默认为Login.aspx)访到网站根目录下,根目录web.config如下
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <appSettings/>
        <connectionStrings/>
        <system.web>
            <compilation debug="false" />
          <authentication mode="Forms">
          </authentication>
          <authorization>
            <allow users="?" />
          </authorization>
        </system.web>
    </configuration>[code]其他页面访到另一目录,比如others目录下,并在other目录下创建
    web.config如下
    [code=XML]<?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.web>
        <authorization>
            <deny users="?" /> 
        </authorization>
     </system.web>
    </configuration>
      

  2.   


    <!--整个网站deny-->
           <system.web>
    <authorization>
    <deny users="?"/>
    </authorization>
    </system.web>
    <!--你要单独设置的页面或文件夹-->
           <location path="folder">
    <system.web>
    <authorization>
    <allow users="?"/>
    </authorization>
    </system.web>
    </location>
      

  3.   

    <!--   匿名アクセスできるファイルまたはページ   -->
    <location path="logo.gif">
    <system.web>
    <authorization>
    <allow users="?"/>
    </authorization>
    </system.web>
    </location>
    <location path="default.aspx">
    <system.web>
    <authorization>
    <allow users="?"/>
    </authorization>
    </system.web>
    </location>
    允许访问的写上相对路径,ALLOW USERS="?",即OK