web.Config阐释

7 篇文章 0 订阅

<?xml version="1.0"?>
<!-- 
    注意: 除了手动编辑此文件以外,您还可以使用 
    Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的
     “网站”->“Asp.Net 配置”选项。
    设置和注释的完整列表在 
    machine.config.comments 中,该文件通常位于 
    WindowsMicrosoft.NetFramework 2.xConfig 中
-->
<configuration>
    <!--应用程序设置-->
    <connectionStrings>
        <add name="TestTeachConnectionString" connectionString="server=.;database=TestTeach;uid=admin;pwd=admin" providerName="System.Data.SqlClient"/>
    </connectionStrings>
    <appSettings/>
    <system.web>
        <!--通用配置设置-->
        <!--
            executionTimeout:请求超时 单位:秒
            maxRequestLength:请求的最大字节数目(KB)
            useFullyQualifiedRedirectUrl:是否需要发送一个完全的Url
            minFreeThreads:线程池中保证可以使用的线程数目
            minLocalRequestFreeThreads:本地的线程数目
            appRequestQueueLimit:请求队列限制的管理
            -->
        <httpRuntime executionTimeout="90" maxRequestLength="4096" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100"/>
        <!--页面配置-->
        <!--
            buffer:发送前是否在服务器上缓存
            enableSessionState:是否启用Session
            enableViewsState:是否启用视图状态
            enableViewsStateMac:是否在机器上使用视图状态
            autoEventWireup:是否自动封装公共的page事件
            smartNavigation:防止页面在回送时候屏幕闪
            pageBaseType:页面的默认基类
            userControlBaseType:用户控件的基类
            validateRequest:检查发送回服务器的内容
            
            -->
        <pages buffer="true" enableSessionState="true" enableViewState="true" enableViewStateMac="false" autoEventWireup="true" smartNavigation="false" pageBaseType="System.Web.UI.Page" userControlBaseType="System.Web.UI.UserControl" validateRequest="true"></pages>
        <!--Session配置-->
        <!--
            stateConnectionString:与远程服务器提供
            stateNetworkTimeout:与远程服务器连接超时的时间(单位:秒)
            sqlConnectionString:数据库连接字符串
            cookies:是否与cookies建立连接
            timeout:Session的时间(单位:分钟)
            备注:
            1.如果需要使用StateServer,需要以下几步
                1.net start aspnet_state       net stop aspnet_state
                2.设置stateConnectionString="tcpip:127.0.0.1:42424" 
                3.如果需要改ip,可以在hkey_local_machine/system/currentcontrolset/services/asp_state/parameters 把AllowRemoteConnection设置为1
                4.如果需要改端口,同上,把port改为自己的端口
            2.如果需要使用sqlserver,需要以下几步
                1.osql.exe
                2.InstallSqlState。sql;UninstallSqlState.sql;InstallPersistSqlState.sql;UninstallPersistSqlState.sql
                3.winntmicrosoft.net ramework[version]  >osql -S localhost -U sa -P <installSqlstate.sql
                4.默认tempDb数据库中
        -->
        <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" stateNetworkTimeout="10" sqlConnectionString="server=.;database=127.0.0.1;uid=sa;pwd=" cookieless="false" timeout="20"></sessionState>
        <!--trace-->
        <!--
            1.requestLimit:每个应用程序高速缓存在内存中的跟踪请求的总数
            2.pageOutput:页面输出----trace.axd
            3.localOnly:只为本地请求启用跟踪
        -->
        <trace enabled="true" requestLimit="10" pageOutput="true" traceMode="SortByTime" localOnly="true"/>
        <!--定制错误-->
        <!--
            1.mode
                1.On:使用用户定义的错误页面
                2.Off:显示页面详细的错误
                3.RemoteOnly:只为访问同一机器上的服务器的用户显示错误页面,其它先检查设置,然后使用defaultRedirect
            2.defaultRedirect:默认的错误页面
            3.定制重定向
                1.statusCode:错误编码
                2.重定向的地址
            
        -->
        <customErrors mode="Off" defaultRedirect="error.aspx">
            <error statusCode="404" redirect="Errors/404.aspx"/>
        </customErrors>
        <!--编译器选项-->
        <!-- 
            debug:是否处于调试模式
            defaultLanguage:默认语言
            tempDirectory:存储dll的目录
            batch:是否支持批编译操作
            batchTimeout:完成批编译的时间(秒)
            maxBatchSize:完成批编译的资源数目(最大1000)
            maxBatchGeneratedFileSize:批编译文件的最大字节数(KB):默认:3000KB
            numRecompilesBeforeAppRestart:允许编译的次数,默认15次
        -->
        <compilation debug="true">
            <assemblies>
                <add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
        <!--国际化编码-->
        <!--
            requestEncoding:
            responseEncoding:
            fileEncoding:
            culture:使用文化字符串本地化(auto)
            uiCulture:寻找资源的文化字符串(auto)
        -->
        <globalization requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8" culture="auto" uiCulture="auto"/>
        <!--
            通过 <authentication> 节可以配置 ASP.NET 使用的 
            安全身份验证模式,
            以标识传入的用户。 
        -->
        <!--<authentication mode="Forms">
            <forms name=".aspxauth" loginUrl="login.aspx" protection="All" timeout="30" path="/">
                <credentials passwordFormat="SHA1">
                    <user name="" password=""/>
                </credentials>
            </forms>    
        </authentication>-->
        <authentication mode="Windows"></authentication>
    </system.web>
</configuration>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值