当前位置: 首页 > 图文教程 > 网络编程 > ASP > ASP+配置 — ASP+配置概念(二)

ASP
Asp+Sql 对数据库的各种操作
ASP:6行代码实现无组件上传
ASP中几种分页显示的比较
ASP中数据库调用中常见错误的现象和解决
ASP实用技巧:强制刷新和判断文件地址
asp全站防止注入的代码
ASP如何获取客户端真实IP地址
ASP实现可显示和隐藏的树型菜单
如何用ASP获取真实IP地址
ASP与SQL数据库连接代码
拒绝攻击 万能Asp防注入代码
草根站长成长计划:跟我学新云采集入门(2)
ASP技巧:提高使用Request集合的效率
Asp用存储过程实现数据分页
做网页时常用的ASP函数
Asp编码优化技巧八则
ASP中Cache技术的应用
用ASP封IP的方法,防止固定IP垃圾留言
ASP实现一行多列显示方法实例程序
ASP实现动态添加表单内容的实例程序

ASP+配置 — ASP+配置概念(二)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 37 ::
收藏到网摘: n/a

  Config.web 配置文件
所有ASP+的配置信息都包括在名叫Config.web的配置文件当中。下面的例子说明了一个ASP+配置文件的结构:


代码:
--------------------------------------------------------------------------------

<!-- CONFIG.WEB FILE --><configuration>   <configsections>      <add names="httpmodules"
type="System.Web.Config.HttpModulesConfigHandler"/>      <add names="httphandlers"
type="System.Web.Config.HttpHandlerConfigHandler"/>      <add names="sessionstate"
type="System.Web.Config.SessionStateConfigHandler"/>      <add names="globalization"
type="System.Web.Config.GlobalizationConfigHandler"/>      <!-- ADDITIONAL CONFIGSECTION DECLARATIONS GO
HERE -->     </configsections>   <httpmodules>      <!-- http module subelements go here -->   
</httpmodules>   <httphandlers>      <!-- http handlers subelements go here -->   </httphandlers>   
<sessionstate>      <!-- session state subelements go here -->   </sessionstate>   <globalization>      <!-
- session state subelements go here -->   </globalization>   <!-- ADDITIONAL CONFIG SECTIONS GO HERE --
></configuration>

--------------------------------------------------------------------------------

所有的配置信息都必须居于<configuration>和</configuration>标记之间。配置文件有两个主要部分。在上部是配置小节
的处理程序声明(包括在<configsection>和</configsection>标记中)。文件的其余部分包括了实际的配置小节(为了清
楚,它们的子元素已被移除)。注意,下面的每一个配置小节都必须对应有一个<configsection>中的声明存在。每一个声
明赋予了配置小节名称并且指出了将处理其配置信息的NGWS Framework Assembly及Class。每一配置小节包含含有ASP+细
节配置设定的子元素。

以下代码举例说明了这些概念:


代码:
--------------------------------------------------------------------------------

<configuration>   <configsections>      <add name="debugmode"
type="System.Web.Config.SingleTagSectionHandler" />       <add name="globalization"
type="System.Web.Config.SingleTagSectionHandler" />      <add name="assemblies"
type="System.Web.UI.AssembliesSectionHandler" />      <add name="security"
type="System.Web.Config.SecurityConfigHandler" />   </configsections>   <debugmode enable="true" />   
<globalization      requestencoding="us-ascii"      responseencoding="iso-8859-1"   />   <assemblies>      
<add assembly="System.Data.dll"/>      <add assembly="System.dll"/>      <add
assembly="System.Drawing.dll"/>      <add assembly="*"/>   </assemblies>   <security>      
<authorization>         <allow users="*" /> <!-- Allow all users -->