
ASP.NET目录级别的问题,无法使用..连接上层目录 30
WEB.CONFIG里定义了数据库的路径,原代码如下:<?xmlversion="1.0"encoding="gb2312"?><configuration><confi...
WEB.CONFIG里定义了数据库的路径,原代码如下:<?xml version="1.0" encoding="gb2312"?>
<configuration>
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
</configSections>
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>~/c(\d{1,8})\.aspx</LookFor>
<SendTo>~/list.aspx?cid=$1</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/c(\d{1,8})p(\d{1,6})\.aspx</LookFor>
<SendTo>~/list.aspx?cid=$1&page=$2</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/n(\d{1,8})c(\d{1,8})\.aspx</LookFor>
<SendTo>~/show.aspx?id=$1&cid=$2</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/n(\d{1,8})c(\d{1,8})p(\d{1,8})\.aspx</LookFor>
<SendTo>~/show.aspx?id=$1&cid=$2&page=$3</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<appSettings>
<add key="Charset" value="gb2312" />
<add key="MDBpath" value="../data/tddiy.mdb" />
<add key="SQLConnString" value="server=(local);UID=sa;PWD=;database=dvnews" />
</appSettings>
<system.web>
<compilation defaultLanguage="C#" debug="false"/>
<pages enableSessionState="true" enableViewState="true"/>
<customErrors mode="Off" />
<globalization fileEncoding="gb2312" requestEncoding="gb2312" responseEncoding="gb2312" culture="zh-CN" />
<httpRuntime maxRequestLength="2048" />
<httpModules>
<add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter" />
</httpModules>
<httpHandlers>
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
<add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro"/>
</httpHandlers>
</system.web>
</configuration>
空间的根目录下有WEB DATA ERRO三个文件夹并存,WEB是网站的根目录,DATA是空间里提供的防下载数据库存放文件夹,现在想把数据库的连接改到DATA下边,无法使用绝对路径,使用..向上的时候提示错误,无法返回上级目录,而WEB下也无法操作设置权限,请大家帮忙想想办法解决这个问题,在此奉上30分,解决后再追加20分,先谢谢了... 展开
<configuration>
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
</configSections>
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>~/c(\d{1,8})\.aspx</LookFor>
<SendTo>~/list.aspx?cid=$1</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/c(\d{1,8})p(\d{1,6})\.aspx</LookFor>
<SendTo>~/list.aspx?cid=$1&page=$2</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/n(\d{1,8})c(\d{1,8})\.aspx</LookFor>
<SendTo>~/show.aspx?id=$1&cid=$2</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/n(\d{1,8})c(\d{1,8})p(\d{1,8})\.aspx</LookFor>
<SendTo>~/show.aspx?id=$1&cid=$2&page=$3</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<appSettings>
<add key="Charset" value="gb2312" />
<add key="MDBpath" value="../data/tddiy.mdb" />
<add key="SQLConnString" value="server=(local);UID=sa;PWD=;database=dvnews" />
</appSettings>
<system.web>
<compilation defaultLanguage="C#" debug="false"/>
<pages enableSessionState="true" enableViewState="true"/>
<customErrors mode="Off" />
<globalization fileEncoding="gb2312" requestEncoding="gb2312" responseEncoding="gb2312" culture="zh-CN" />
<httpRuntime maxRequestLength="2048" />
<httpModules>
<add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter" />
</httpModules>
<httpHandlers>
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
<add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro"/>
</httpHandlers>
</system.web>
</configuration>
空间的根目录下有WEB DATA ERRO三个文件夹并存,WEB是网站的根目录,DATA是空间里提供的防下载数据库存放文件夹,现在想把数据库的连接改到DATA下边,无法使用绝对路径,使用..向上的时候提示错误,无法返回上级目录,而WEB下也无法操作设置权限,请大家帮忙想想办法解决这个问题,在此奉上30分,解决后再追加20分,先谢谢了... 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询