当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > web.config配置文件示例

ASP.NET
Active Directory 对象的控制
在vb中动态加载水晶报表rpt文件的方法
webconfig中进行登陆的权限、修改2
DataGrid(WinForm)显示行号最简单的方法
在EXCEL中获取列中不重复的值的个数
使用Visual C#制作可伸缩个性化窗体
关于控件注册和使用许可问题的解决办法
获取闭合符号中的字符串
判断点与多边形的状态(位置)
NHibernate初试
GetTickCount()函数精确到多少毫秒
VB.net中HOOK的应用(一)
C# to VB.Net translator..
用Visual C#调用Windows API函数
用API函数实现切换VCD的左右声道
元数据--自定义属性(VB.NET)
初学VB.NET连接SQL数据库
简单的DataGrid多表头制作方法
带输出参数的存储过程的使用及在C#中调用问题
VS的控件真是不好用,好不容易才搞定DataGrid

ASP.NET 中的 web.config配置文件示例


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

 

为了方便配置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"
            connect