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

首頁 > 開發 > 綜合 > 正文

web.config配置文件示例

2024-07-21 02:28:34
字體:
來源:轉載
供稿:網友


為了方便配置web.config文件,我寫了一個常用的web.config文件的示例,可以以此為模版根據需要修改。
創建web.config文件的三種快捷方法:
    1、用vs2005中的asp.net網站配置工具配置
    2、參考c:/windows/microsoft.net/framework/v2.0.50727(.net framework版本)/config/目錄下的machine.config 文件進行編寫
    3、以下邊這個文件作模版修改


點擊此處展開代碼
<?xml version="1.0" encoding="utf-8"?>
<!--
    注意: 除了手動編輯此文件以外,您還可以使用
    web 管理工具來配置應用程序的設置。可以使用 visual studio 中的
     “網站”->“asp.net 配置”選項。
    設置和注釋的完整列表在
    machine.config.comments 中,該文件通常位于
    /windows/microsoft.net/framework/v2.x/config 中
-->
<configuration xmlns="http://schemas.microsoft.com/.netconfiguration/v2.0">
  <appsettings>
    <!-- enable data caching -->
    <add key="enablecaching" value="true"/>
  </appsettings>
  <connectionstrings>
    <add name="strconnuserdb"
         connectionstring="data source=.;initial catalog=profile1;integrated security=true"
         providername="system.data.sqlclient" />
  </connectionstrings>
  <system.web>

    <membership>
      <providers>
        <remove name="aspnetsqlmembershipprovider" />
        <add name="aspnetsqlmembershipprovider"
             type="system.web.security.sqlmembershipprovider, system.web, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a"
             connectionstringname="strconnuserdb"
             enablepasswordretrieval="false"
             enablepasswordreset="true"
             requiresquestionandanswer="true"
             applicationname="/"
             requiresuniqueemail="false"
             passwordformat="hashed"
             maxinvalidpasswordattempts="5"
             minrequiredpasswordlength="7"
             minrequirednonalphanumericcharacters="1"
             passwordattemptwindow="10"
             passwordstrengthregularexpression=""
             description="存儲membership數據"
         />
      </providers>
    </membership>
    <profile enabled="true" defaultprovider="aspnetsqlprofileprovider" inherits="">
      <providers>
      <remove name="aspnetsqlprofileprovider" />
      <add name="aspnetsqlprofileprovider"
            connectionstringname="strconnuserdb"
            applicationname="/"
            type="system.web.profile.sqlprofileprovider, system.web, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a"
            description="存儲profile數據"
         />
      </providers>
       <properties>
        <add name="name"/>
        <add name="backcolor" type="system.drawing.color" allowanonymous="true" serializeas="binary"/>
      </properties>
    </profile>
   
    <rolemanager enabled="true" cacherolesincookie="true">
      <providers>
        <remove name="aspnetsqlroleprovider" />
        <add name="aspnetsqlroleprovider"
        connectionstringname="strconnuserdb"
        applicationname="/"
        type="system.web.security.sqlroleprovider, system.web, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a"
        description="存儲role數據"
          />
      </providers>
    </rolemanager>
    <!-- other rolemanager attributes (and their defaults) include:
            cookiename=".aspxroles"       
            cookietimeout="30"
            cookiepath="/"       
            cookierequiressl="false"       
            cookieslidingexpiration="true"  // renew expiring cookies?
            createpersistentcookie="false"  // issue persistent cookie?
            cookieprotection="all" />          // cookie protection level
     -->
    <compilation debug="false" />
    <authentication mode="forms" />
    <!--
        <anonymousidentification
            enabled="true"
            cookiename=".aspxanonymous"
            cookietimeout="43200"
            cookiepath="/"
            cookierequiressl="false"
            cookieslidingexpiration="true"
            cookieprotection="all"
            cookieless="usecookies"
         />
     -->   
    <!--
        <customerrors mode="remoteonly" defaultredirect="genericerrorpage.htm">
            <error statuscode="403" redirect="noaccess.htm" />
            <error statuscode="404" redirect="filenotfound.htm" />
        </customerrors>
     -->
  </system.web>
  <location path="user">
    <system.web>
      <authorization>
        <allow roles="?" />
        <deny users="*"/>
      </authorization>
    </system.web>
  </location>
</configuration>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 芒康县| 惠来县| 南平市| 扎兰屯市| 福安市| 龙海市| 康定县| 西畴县| 荥阳市| 远安县| 普兰店市| 聊城市| 西乌珠穆沁旗| 无棣县| 苍溪县| 霸州市| 沈丘县| 广河县| 香河县| 阳泉市| 梅州市| 合水县| 麻阳| 敖汉旗| 远安县| 金门县| 密云县| 莲花县| 潼关县| 衡东县| 措美县| 田林县| 五常市| 北辰区| 鹿泉市| 勐海县| 凤城市| 柯坪县| 盐津县| 墨竹工卡县| 榕江县|