亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

動(dòng)易SiteFactory配置文件(web.config)常用配置節(jié)解讀

  發(fā)布時(shí)間:2013-02-24 14:24:35   作者:佚名   我要評(píng)論
本文主要介紹一下動(dòng)易SiteFactory配置文件(web.config)常用配置節(jié),感興趣的你可千萬(wàn)不要錯(cuò)過(guò)了哈,希望本文可以幫助到你
配置聲明節(jié)

復(fù)制代碼
代碼如下:

<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>

這個(gè)節(jié)定義了,web.config文件中將要用到具體配置節(jié)點(diǎn)的名稱,處理程序等.
從這里可以看出,siteFactory里采用.net 企業(yè)應(yīng)用程序塊(enterpriseLibrary),里的數(shù)據(jù)訪問(wèn)塊等.
urlrewritingnet,是用來(lái)進(jìn)行地址重寫的,接著是asp.net ajax 配置節(jié)聲明,最后有個(gè)sectionGroup聲明,里面的配置節(jié)聲明分別是,siteFactory頁(yè)面訪問(wèn)控制(安全),頁(yè)面訪問(wèn)參數(shù)等(.aspx?xxx 問(wèn)號(hào)后面的xxx部分)
聲明節(jié)后就是具體的數(shù)據(jù)配置節(jié)點(diǎn)了

復(fù)制代碼
代碼如下:

<connectionStrings configSource="Config\ConnectionStrings.config" />

這個(gè)就是數(shù)據(jù)庫(kù)連接字符串的配置,具體的數(shù)據(jù)在config目錄下的ConnectionStrings.config文件里,打開這個(gè)文件可以看到如下內(nèi)容

復(fù)制代碼
代碼如下:

<!--指定數(shù)據(jù)庫(kù)連接字符串(名稱/值對(duì)的形式)的集合。-->
<connectionStrings>
<add name="Connection String" connectionString="server=.;database=SiteFactory;uid=PowerEasy;pwd=123456"
providerName="System.Data.SqlClient" />
</connectionStrings>

這里就是大家熟悉的數(shù)據(jù)庫(kù)連接字符串內(nèi)容了,根據(jù)需要你可以將connectionString="xxx"里面的xxx內(nèi)容改成你當(dāng)前數(shù)據(jù)庫(kù)連接配置.

復(fù)制代碼
代碼如下:

<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" />
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
<add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add verb="*" path="*.jpg" type="PowerEasy.Web.NoLeechImageHandler, PowerEasy.Web" />
<add verb="*" path="*.gif" type="PowerEasy.Web.NoLeechImageHandler, PowerEasy.Web" />
<add verb="*" path="*.png" type="PowerEasy.Web.NoLeechImageHandler, PowerEasy.Web" />
</httpHandlers>

這里是處理程序配置,前面幾個(gè)是asp.net ajax的,后面3個(gè)是siteFactory用來(lái)防止圖片盜連用的,具體的實(shí)現(xiàn)思路是,判斷圖片文件請(qǐng)求的標(biāo)頭中的Referrer是否是本網(wǎng)站的地址,如果你的網(wǎng)站不存在防盜連需求(向來(lái)多是你盜用別人的"_-!)你可以用

復(fù)制代碼
代碼如下:

<!--
<add verb="*" path="*.jpg" type="PowerEasy.Web.NoLeechImageHandler, PowerEasy.Web" />
<add verb="*" path="*.gif" type="PowerEasy.Web.NoLeechImageHandler, PowerEasy.Web" />
<add verb="*" path="*.png" type="PowerEasy.Web.NoLeechImageHandler, PowerEasy.Web" />
-->標(biāo)價(jià)將3個(gè)注釋掉
<httpModules>
<add name="RefreshModule" type="PowerEasy.Web.HttpModule.RefreshModule, PowerEasy.Web" />
<add name="CommonModule" type="PowerEasy.Web.HttpModule.CommonModule, PowerEasy.Web" />
<add name="IPLockModule" type="PowerEasy.Web.HttpModule.IPLockModule, PowerEasy.Web" />
<add name="ExceptionModule" type="PowerEasy.Web.HttpModule.ExceptionModule, PowerEasy.Web" />
<add name="SecurityModule" type="PowerEasy.Web.HttpModule.SecurityModule, PowerEasy.Web" />
<add name="QueryStringModule" type="PowerEasy.Web.HttpModule.QueryStringModule, PowerEasy.Web" />
<add name="HttpUploadModule" type="PowerEasy.Controls.ExtendedUploadFile.HttpUploadModule, PowerEasy.Controls" />
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
</httpModules>

是處理模塊,除了ScriptModule是asp.net ajax指定的處理模塊外,其他的多是siteFactory的,你可以根據(jù)情況屏蔽掉一些
比方RefresModule是防刷新用的,IPLokeModule是用來(lái)屏蔽IP的....
另外注意在web.config后面有個(gè)<system.webServer>...</system.webServer> 節(jié),這個(gè)是IIS7.0中新增加的,性質(zhì)跟上面的<httpHandlers><httpModules>一樣的.

復(fù)制代碼
代碼如下:

<!--為當(dāng)前應(yīng)用程序配置會(huì)話狀態(tài)設(shè)置。-->
<sessionState mode="InProc" timeout="20">
表示用戶會(huì)話保存在進(jìn)程內(nèi)20表示是失效時(shí)間,不過(guò)sessionState實(shí)際的失效時(shí)間取決于服務(wù)器的負(fù)擔(dān).
<urlMappings enabled="true">
<clear />
<add url="~/Index.aspx" mappedUrl="~/Default.aspx" />
<add url="~/User/Index.aspx" mappedUrl="~/User/Default.aspx" />
</urlMappings>
urlMappings 是.net2.0自帶的地址重寫機(jī)智,不支持正則表達(dá)式,但是一般的應(yīng)用多可以滿足,并且很方便
<webParts>
<personalization defaultProvider="WebPartPersonalizationProvider">
<providers>
<add name="WebPartPersonalizationProvider" type="PowerEasy.UserManage.WebPartProvider, PowerEasy.UserManage" />
</providers>
</personalization>
</webParts>

這一段是SiteFactory提供的WebParts個(gè)性數(shù)據(jù)保存的配置,另外asp.net2.0也提供sql實(shí)現(xiàn)的一個(gè)提供程序,你可以使用aspnet_regsql來(lái)實(shí)現(xiàn).

復(fù)制代碼
代碼如下:

<urlrewritingnet configSource="Config\UrlRewriteSettings.config" />
<powereasy.web>
<security configSource="Config\Security.config" />
<!--指定頁(yè)面?zhèn)鬟f參數(shù)的集合。-->
<queryStrings configSource="Config\QueryStrings.config" />
</powereasy.web>

這幾對(duì)的數(shù)據(jù)多是在其指頂?shù)奈募?你可以去config目錄下查看,
例外config目錄下有CreateCollectionWork.config,CreateHtmlWork.config是數(shù)據(jù)采集,與將靜態(tài)頁(yè)生成用的,目的是用來(lái)在進(jìn)程間交換信息的.Site.config等是具體數(shù)據(jù)文件,通過(guò)類序列化保存的,比方防刷新隊(duì)列的長(zhǎng)度就保存在這里文件里,你可以通過(guò)后臺(tái)配置修改,也可以在這里直接修改.

相關(guān)文章

最新評(píng)論