动易SiteFactory配置文件(web.config)常用配置节解读

配置声明节

复制代码代码如下:
<configSections>
<section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<section name="urlrewritingnet" requirePermission="false" type="UrlRewritingNet.Configuration.UrlRewriteSection, UrlRewritingNet.UrlRewriter" />
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" />
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
</sectionGroup>
</sectionGroup>
</sectionGroup>
<sectionGroup name="powereasy.web" type="PowerEasy.Web.Configuration.ComponentsSectionGroup, PowerEasy.Web">
<section name="queryStrings" type="PowerEasy.Web.Configuration.QueryStringsSection, PowerEasy.Web" />
<section name="security" type="PowerEasy.Web.Configuration.SecuritySection, PowerEasy.Web" />
</sectionGroup>
</configSections>

这个节定义了,web.config文件中将要用到具体配置节点的名称,处理程序等.
从这里可以看出,siteFactory里采用.net 企业应用程序块(enterpriseLibrary),里的数据访问块等.
urlrewritingnet,是用来进行地址重写的,接着是asp.net ajax 配置节声明,最后有个sectionGroup声明,里面的配置节声明分别是,siteFactory页面访问控制(安全),页面访问参数等(.aspx?xxx 问号后面的xxx部分)
声明节后就是具体的数据配置节点了

复制代码代码如下:
<connectionStrings configSource="Config\ConnectionStrings.config" />

这个就是数据库连接字符串的配置,具体的数据在config目录下的ConnectionStrings.config文件里,打开这个文件可以看到如下内容

复制代码代码如下:
<!--指定数据库连接字符串(名称/值对的形式)的集合。-->
<connectionStrings>
<add name="Connection String" connectionString="server=.;database=SiteFactory;uid=PowerEasy;pwd=123456"
providerName="System.Data.SqlClient" />
</connectionStrings>

这里就是大家熟悉的数据库连接字符串内容了,根据需要你可以将connectionString="xxx"里面的xxx内容改成你当前数据库连接配置.

复制代码代码如下:
<httpHandlers>
<remove verb="*" path="*.asmx" />
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

动易SiteFactory配置文件(web.config)常用配置节解读

扫一扫手机访问