根目录下的文件允许所有人访问,
在根目录下有一个manage的文件夹,其下有一个login.aspx文件,
要求,manage下访问其它文件都定位到该文件,并通过数据库中验证用户名密码进行登陆还请指点一下,如何配置web.config

解决方案 »

  1.   

    參考:
    http://community.csdn.net/Expert/topic/3973/3973013.xml?temp=.4131739
      

  2.   

    orcale() ( ) 信誉:99 
    to:这个帖子好像是将URL重写,和我的这个问题,好像没关系啊
      

  3.   

    http://community.csdn.net/Expert/topic/4007/4007008.xml?temp=.3160669
      

  4.   

    如果没登录就重定向到该问文件。如果有iis error 404 这种东西,那么就在iis里设为manage为虚拟目录,再在自定义错误里把404错误转向到URL
      

  5.   

    MSDN参考如下 
    通过使用具有适当的 path 属性的 <location> 标记,可以将配置设置应用于特定的资源。path 属性可用于标识对其应用唯一配置设置的特定的文件或子目录。 
    例如,下面的配置文件在三个级别指定设置:  
    应用于当前目录和所有子目录的设置(全部内容包含在顶部 <configuration> 标记中)。  
    应用于 Sub1 子目录的设置(全部内容包含在 <location> 标记中,路径属性设置为 Sub1)。  
    应用于 Sub2 子目录的设置(全部内容包含在 <location> 标记中,路径属性设置为 Sub2)。  
    <configuration> 
       <system.web>   
          <sessionState cookieless="true" timeout="10"/> 
       </system.web> 
              
       <!— Configuration for the "Sub1" subdirectory. --> 
       <location path="sub1"> 
          <system.web> 
             <httpHandlers> 
                <add verb="*" path="Sub1.Scott" type="Sub1.Scott"/> 
                <add verb="*" path="Sub1.David" type="Sub1.David"/> 
             </httpHandlers> 
          </system.web> 
       </location> 
        
       <!— Configuration for the "Sub2" subdirectory. --> 
       <location path="sub2"> 
          <system.web> 
             <httpHandlers> 
                <add verb="*" path="Sub2.Scott" type="Sub2.Scott"/> 
                <add verb="*" path="Sub2.David" type="Sub2.David"/> 
             </httpHandlers> 
          </system.web> 
       </location> 
    </configuration> 
      

  6.   

    <?xml version="1.0" encoding="utf-8" ?>
      <configuration>
        <system.web>
          <authentication mode="Forms">
            <loginUrl="login.aspx" protection="All" />
          </authentication>
        </system.web>    <location path="manage">
          <system.web>
            <authorization>
              <deny users="?" />
            </authorization>
          </system.web>
        </location>  </configuration>
      

  7.   

    在你要控制的目录下放一个Web.config文件,要求验证访问就行了