国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

Websharp使用說明(6)

2024-07-21 02:17:16
字體:
來源:轉載
供稿:網友
websharp應用系統的配置

1、 緩存的配置

websharp使用了微軟的cached application block來緩存數據,因此,下面的緩存信息必須在應用程序中添加。關于cached application block,可以參見微軟的相關文檔。

<configuration>

<configsections>

<section name="cachemanagersettings" type="microsoft.applicationblocks.cache.cacheconfigurationhandler,microsoft.applicationblocks.cache" />

<section name="websharpexpirationpolicy" type="websharp.service.websharpcofigurationhandler,websharp" />

</configsections>

<cachemanagersettings>

<!-- data protection settings

use dataprotectioninfo to set the assembly and class which implement

the dataprotection interfaces for the cache.

-->

<dataprotectioninfo assemblyname="microsoft.applicationblocks.cache"

classname="microsoft.applicationblocks.cache.dataprotection.defaultdataprotection"

validationkey="oci44oq9c3xadq3/bmhpkspfzetezlkxen/ahq8t7nvk/kmgafnssqjr00kunhrso+mplvwaingep6i14x9m+a=="

validation="sha1"/>



<!-- storage settings

use storageinfo to set the assembly and class which implement

the storage interfaces for the cache.



modes: inproc, outproc

-->

<storageinfo assemblyname="microsoft.applicationblocks.cache" classname="microsoft.applicationblocks.cache.storages.singletoncachestorage" mode="inproc" validated="true" encrypted="true" remotingurl="tcp://localhost:8282/cacheservice" />

<!--storageinfo assemblyname="microsoft.applicationblocks.cache" classname="microsoft.applicationblocks.cache.storages.sqlservercachestorage" mode="inproc" connectionstring="user id=sa;password=msljkdv1;network=dbmssocn;database=cacheab;server=msljksrv02" encrypted="true" validated="true" applicationname="sports" remotingurl="tcp://localhost:8282/cacheservice" /-->

<!--<storageinfo assemblyname="microsoft.applicationblocks.cache" classname="microsoft.applicationblocks.cache.storages.mmfcachestorage" mode="inproc" basepath="c:/mmfcache/" encrypted="true" validated="true" mmfdictionarysize="1048576" remotingurl="tcp://localhost:8282/cacheservice"/>-->



<!--

mmfdictionarysize - it is the size (in bytes) of the dictionary object (in mmfcachestorage) used to store the references of cache items.

-->



<!-- scavenging settings

use the scavengingalgorithm to set a class that will be executed when

scavenging is performed.

-->



<scavenginginfo assemblyname="microsoft.applicationblocks.cache" classname="microsoft.applicationblocks.cache.scavenging.lruscavenging" memorypollingperiod="60" utilizationforscavenging="80" maximumsize="5"/>

<!-- expiration settings

use the expirationcheckinterval to change the interval to check for

cache items expiration. the value attribute is represented in seconds.

-->

<expirationinfo interval="1" />

</cachemanagersettings>

<websharpexpirationpolicy>

<expirationpolicy expirationcheckinterval="60" assemblyname="microsoft.applicationblocks.cache" classname="microsoft.applicationblocks.cache.expirationsimplementations.slidingtime" />

</websharpexpirationpolicy>

</configuration>




2、 系統持久化配置信息

配置persistenceproperty,對于web應用系統,可以在global.asax中配置,對于windows應用程序,可以在程序初始化時設置。

下面是設置的一個例子:

persistenceproperty pp=new persistenceproperty();

pp.connectionstring="server=127.0.0.1;uid=sa;pwd=;database=logisticsdemo;";//數據庫連接字符串

pp.databasetype=databasetype.mssqlserver; //數據庫類型

[email protected]"websharptestlib,websharptestlib.xml"; //xml定義文件的路徑

pp.mapfilelocationtye=mapfilelocationtype.assembly; //xml文件路徑的類型

pp.userid="sa"; //數據庫用戶名,必須與數據庫連接字符串中的用戶名一致

pp.password=""; //數據庫用戶密碼,必須與數據庫連接字符串中的用戶密碼一致

applicationconfiguration.defaultpersistenceproperty=pp; //設置應用程序的默認配置屬性


配置信息的說明如下:

1) 數據庫連接字符串、用戶名和密碼的設置按照常規設置

2) mapfilelocationtye指明xml映射文件的路徑類型,可以有三種類型:

a) absolutepath:采用絕對路徑的形式,在這種情況下,mapfilelocation設置成絕對路徑的形式,如:“d:/apppath/xml”。

b) virtualpath:對于web應用程序,可以設置為虛擬路徑的形式,如“/mywebapp/entitydefinitions/”。

c) assembly:xml文件作為資源文件被編譯。采用這種形式,需要將xml文件的生成操作屬性設置成“嵌入的資源”,這種情況下,mapfilelocation的格式為:“assemblyname,namespace”。例如,xml文件位于websharptestlib項目的xml文件夾下面,mapfilelocation可以設置為:“websharptestlib,websharptestlib.xml”
  • 本文來源于網頁設計愛好者web開發社區http://www.html.org.cn收集整理,歡迎訪問。
  • 發表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發表
    主站蜘蛛池模板: 永靖县| 阜康市| 平阴县| 洱源县| 长沙县| 盐边县| 祁阳县| 宝清县| 化隆| 湖州市| 贵港市| 潞城市| 崇信县| 广汉市| 镇康县| 宝应县| 吴忠市| 宁阳县| 晋城| 高邑县| 缙云县| 河池市| 浏阳市| 崇信县| 隆昌县| 浦县| 纳雍县| 广宁县| 高淳县| 西宁市| 资源县| 保德县| 荥经县| 新龙县| 乌兰察布市| 尤溪县| 遂平县| 河源市| 呼伦贝尔市| 普格县| 湖口县|