ASP. NET Web. config 설정 파일 의 기본 사용 방법

26559 단어 asp.net
          ASP.NET Web.config           。       ,  Web.config      ,         。                。



<?xml version="1.0"?>



<!--  :            ,       Web               。     Visual Studio   “  ”->“Asp.Net   ”  。



            machine.config.comments  ,        "Windows"Microsoft.Net"Framework"v2.x"Config  。-->



 <!--Webconfig     xml  ,configuration xml      ,  xml           ,  Webconfig                。-->



<configuration>



  <!--            。clear:               ,       section   sectionGroup          。remove:             。



 section:                   。sectionGroup:                  。-->



 <configSections>



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



    </sectionGroup>



    <section name="rewriter" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" />



 </configSections>



 



 <!--appSettings       ,                  -->



     <appSettings>



 <add key="1" value="1" />



 <add key="gao" value="weipeng" />



 </appSettings>



 



 <!--       -->



 <connectionStrings>



    <add name="ConnString" connectionString="Data Source=GAO;Initial Catalog=HBWXDate;User ID=sa;password=sa"></add>



    <add name="111" connectionString="11111" />



 </connectionStrings>



 



 <!--            ,       ,             。page              .allowOverride           ,          -->



 <location path="Default.aspx" allowOverride="false">



    <!--  asp.net      -->



<system.web>



    <!--identity  web           .-->



    <identity impersonate="false" />



    



    <!--           (         、    ,          )。<pages>      、  、            .



                    Index,   Default,                          ( :       ,         ,               ),                   ,                 。( :        )  ViewState-->



    <pages masterPageFile="Index" theme="Default" buffer="true" enableViewStateMac="true" validateRequest="false" enableViewState="false">



      <!--controls             register           -->



      <controls></controls>



      <!--                    -->



      <namespaces></namespaces>



    </pages>



    



    <!--       ,mode:  On,Off,RemoteOnly 3   。On            ; Off         asp.net    ; RemoteOnly        Web                .defaultRedirect:           URL  -->



    <customErrors defaultRedirect="Err.html" mode="RemoteOnly">



      <!--              -->



      <error statusCode="403" redirect="NoAccess.htm" />



      <error statusCode="404" redirect="FileNotFound.htm" />



    </customErrors>



    



    <!--       :            (  ),      ,          (15),         -->



    <trace enabled="true" localOnly="false" pageOutput="true" requestLimit="15" traceMode="SortByCategory"/>



    



    <!--    compilation debug="true"               。         ,                true。         C#。batch       -->



    <compilation debug="true" defaultLanguage="c#" batch="false">



      <assemblies>



        <!--       ,        ,                   ,               -->



        <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>



        <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>



        <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>



        <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>



        <add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>



        <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>



        <add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>



        <add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>



        <add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>



        <add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>



        <add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>



      </assemblies>



      <!--                       。-->



      <buildProviders>



        <!---->



        <add extension=".aspx" type="System.Web.Compilation.PageBuildProvider"/>



        <add extension=".ascx" type="System.Web.Compilation.UserControlBuildProvider"/>



        <add extension=".master" type="System.Web.Compilation.MasterPageBuildProvider"/>



        <add extension=".asmx" type="System.Web.Compilation.WebServiceBuildProvider"/>



        <add extension=".ashx" type="System.Web.Compilation.WebHandlerBuildProvider"/>



        <add extension=".soap" type="System.Web.Compilation.WebServiceBuildProvider"/>



        <add extension=".resx" type="System.Web.Compilation.ResXBuildProvider"/>



        <add extension=".resources" type="System.Web.Compilation.ResourcesBuildProvider"/>



        <add extension=".wsdl" type="System.Web.Compilation.WsdlBuildProvider"/>



        <add extension=".xsd" type="System.Web.Compilation.XsdBuildProvider"/>



        <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>



      </buildProviders>



    </compilation>



    



      <!--   <authentication>       ASP.NET             ,        。Windows:   IIS    ,Forms:            ,Passport:   Passport cookie    ,None:          -->



    <authentication mode="Forms">



      <!--Name:          Http cookie   .LoginUrl:                  URL,       ,       。Protection:    cookie       . 



          :All      ,            ,None     Cookie,Encryption   Cookie      ,validation   Cookie         ,TimeOut:   Cookie     .         。-->



      <forms name=".ASPXUSERDEMO" loginUrl="Login.aspx" protection="All" timeout="30"/>



    </authentication>



    <!--    URL         (         )。          (   、  、    、     )   。   <authentication>      。                  。    weipeng-->



    <authorization>



      <allow users="*"/>



      <deny users="weipeng"/>



      <allow users="aa" roles="aa" />



    </authorization>



    <!--       ,requestEncoding:                .responseEncoding:              .fileEncoding:    aspx,asax          ,      utf-8-->



    <globalization requestEncoding="gb2312" responseEncoding="gb2312" fileEncoding="gb2312" />



    <!--      。mode:   off,Inproc,StateServer,SqlServer     mode = InProc         :       ,    ,             .mode = "StateServer"            :                ,     。             ,           ,     . mode="SqlServer"    sql server   :       ,       



    stateConnectionString :  asp.net                 ,     。sqlConnectionString:          ,          。Cookieless:   flase ,    cookie         .timeout        。-->



    <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20"></sessionState>



    <!--  ASP.NET               。               。-->



    <sessionPageState historySize="9"/>    



    <!--  asp.net http      。      ,  ,            



             100,           80 ,           ,   4M。useFullyQualifiedRedirectUrl                     。-->



    <httpRuntime appRequestQueueLimit="100" executionTimeout="80" maxRequestLength="40960" useFullyQualifiedRedirectUrl="false"/>



    <!--httpModules           HTTP   。-->



    <httpModules>



      <add name="OutputCache" type="System.Web.Caching.OutputCacheModule" />



      <add name="Session" type="System.Web.SessionState.SessionStateModule" />



      <add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule" />



      <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />



      <add name="PassportAuthentication" type="System.Web.Security.PassportAuthenticationModule" />



      <add name="RoleManager" type="System.Web.Security.RoleManagerModule" />



      <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" />



      <add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule" />



      <add name="AnonymousIdentification" type="System.Web.Security.AnonymousIdentificationModule" />



      <!--    URL  ,type     dll -->



      <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" />



      <add name="Profile" type="System.Web.Profile.ProfileModule" />



    </httpModules> 



    <!--httpHandlers         URL HTTP                 。                 ,                            。



    add:            /  。clear:                    。remove:            /  。remove          add      /        。         。-->



    <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="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>



    </httpHandlers>



    <!--  Web         Cookie     。domain:   Cookie   。httpOnlyCookies:  Internet Explorer 6 SP1     HttpOnlyCookies Cookie    。     false。requireSSL:                 (SSL)     .-->



    <httpCookies httpOnlyCookies="false" requireSSL="false"/> 



    <!--   ASP.NET Web           。protocols:      ,ASP.NET              HTTP-->



    <webServices>



      <protocols>



        <add/>



      </protocols>



    </webServices>



    <!--  Web           。cache:            。outputCache :               。outputCacheSettings:                    。sqlCacheDependency:  ASP.NET        SQL      。-->



    <caching>



      <cache disableMemoryCollection = "false" disableExpiration = "false" privateBytesLimit = "0" percentagePhysicalMemoryUsedLimit = "90" privateBytesPollTime = "00:02:00"/>



      <!--              ,            :<%@ OutputCache CacheProfile="ServerOnly" %>-->



      <outputCacheSettings>



        <outputCacheProfiles>



          <add name="ServerOnly" duration="60" varyByCustom="browser" location="Server" />



        </outputCacheProfiles>



      </outputCacheSettings>



    </caching>



     </system.web>





 </location>



 <!--    ,authenticationModules:      Internet            。connectionManagement:    Internet           。defaultProxy:          (HTTP)      。



 mailSettings:           (SMTP)       。requestCaching:           。settings:   System.Net        。-->



 <system.net>



 <!--  SMTP      -->



 <mailSettings>



   <smtp from="weipeng">



    <network host="Gao" password="" userName="" />



   </smtp>



 </mailSettings>



   <!--      -->



   <requestCaching disableAllCaching="true"></requestCaching>



   <!--      ,        contoso.com     。-->



   <defaultProxy>



     <proxy usesystemdefault="True" proxyaddress="http://192.168.1.10:3128" bypassonlocal="True"/>



     <bypasslist>



       <add address="[a-z]+".contoso".com" />



     </bypasslist>



   </defaultProxy>



 </system.net>



 <!--      httpHandlers   httpModules        AJAX     HTTP        。    IIS 7.0                      。 iis7.0     ASP.NET AJAX    system.webServer 



  。       IIS         。 -->



 <system.webServer>



    <validation validateIntegratedModeConfiguration="false"/>



    <modules>



      <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>



    </modules>



    <handlers>



      <remove name="WebServiceHandlerFactory-Integrated"/>



      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>



      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>



      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>



    </handlers>



 </system.webServer>



 



 <!--ASP.NET AJAX     ASP.NET   -->



 <system.web.extensions>



    <!--   JSON    -->



    <scripting>



      <webServices>



        <jsonSerialization maxJsonLength="5000"/>



      </webServices>



    </scripting>



 </system.web.extensions>



 <!-- WCF     -->



 <system.serviceModel>



    <services>



      <service name="WCFStudent.WCFStudentText" behaviorConfiguration="ServiceBehavior">



        <!-- Service Endpoints -->



        <endpoint address="" binding="wsHttpBinding" contract="WCFStudent.IStuServiceContract">



          <!--    ,            ,               。    ,WCF          。-->



          <identity>



            <dns value="localhost"/>



          </identity>



        </endpoint>



        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>



      </service>



    </services>



    <behaviors>



      <serviceBehaviors>



        <behavior name="ServiceBehavior">



          <!--           ,             false              -->



          <serviceMetadata httpGetEnabled="true"/>



          <!--                 ,         truefalse          -->



          <serviceDebug includeExceptionDetailInFaults="false"/>



        </behavior>



      </serviceBehaviors>



    </behaviors>



 </system.serviceModel>



 



 <!--URL   -->



 <rewriter>



    <rewrite url="~/user/u(.+).aspx" to="~/user/index.aspx?r=$1" />



    <rewrite url="~/ask/q(.+).aspx" to="~/home/ask/content.aspx?id=$1" />



    <rewrite url="~/blog/b(.+).aspx" to="~/home/blog/article.aspx?r=$1" />



    <rewrite url="~/news/n(.+).aspx" to="~/home/news/content.aspx?nid=$1" />



    <rewrite url="~/default.aspx" to="~/home/ram/net.aspx" />



 </rewriter>



</configuration>

좋은 웹페이지 즐겨찾기