邙山之巅 承接网站建设 + 网站推广 + 网站优化 + IDC + 网络广告等业务。

本博客网页模板,经过SEO优化和测试, 保证其 完整性 + 无错性 + 美观性 + 最简性 !
完整性 -头部尾部完整,首页,列表,内容完整.无错性 -整站模板安装即可使用,Js无错误,兼容IE6,IE7,ie8,FF
美观性 -整体协调,美观大方,配色合理.最简性 -采取DIV+CSS布局,整站无垃圾代码,架构合理,减少下载时间,节省带宽

WebConfig的经典使用,大家一起交流一下吧!!!

时间:2011-12-27 23:31来源: 作者:admin 点击:
<?xml version="1.0"?>
<!-- 
    注意: 除了手动编辑此文件以外,您还可以使用 
    Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的
     “网站”
->“Asp.Net 配置”选项。
    设置和注释的完整列表在 
    machine.config.comments 中,该文件通常位于 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
    
<configSections>
        
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                    
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
                    
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                
</sectionGroup>
            
</sectionGroup>
        
</sectionGroup>
    
</configSections>
    
<appSettings>
        
<add key="CRMonnection" value="Data Source=192.168.107.89;Initial Catalog=CRM;Integrated Security=false;uid=nouter;Password=123456"></add>
        
<add key="ForumName" value="苏飞"/>
    
</appSettings>
    
<connectionStrings/>
  
<!--意思是让这个目录给所有的用户访问-->
  
<location path ="Error.aspx">
    
<system.web >
      
<authorization>
        
<allow  users ="?"/>
      
</authorization>
    
</system.web>
  
</location>
  
<!--意思是让这个目录给所有的用户访问-->
  
<location path ="ErrorVal.aspx">
    
<system.web >
      
<authorization>
        
<allow  users ="?"/>
      
</authorization>
    
</system.web>
  
</location>
  
<!--意思是让这个目录给所有的用户访问-->
  
<location path ="LoginImages">
    
<system.web >
      
<authorization>
        
<allow  users ="?"/>
      
</authorization>
    
</system.web>
  
</location>
  
<!--意思是让这个目录中指定的文件给所有的用户访问-->
  
<location path ="SystemSetting/CheckCode.aspx">
    
<system.web >
      
<authorization>
        
<allow  users ="?"/>
      
</authorization>
    
</system.web>
  
</location>
    
<system.web>
        
<!-- 
            设置 compilation debug
="true" 可将调试符号插入
            已编译的页面中。但由于这会 
            影响性能,因此只在开发过程中将此值 
            设置为 
true
        
-->
        
<compilation debug="true">
            
<assemblies>
                
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                
<add assembly="Telerik.Charting, Version=2.0.2.0, Culture=neutral, PublicKeyToken=D14F3DCC8E3E8763"/>
                
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies>
        
</compilation>
        
<!--
            通过 
<authentication> 节可以配置 ASP.NET 用来 
            识别进入用户的
            安全身份验证模式。 
        
-->
    
<authentication  mode ="Forms" >
      
<forms loginUrl="Login.aspx"  name ="login"></forms>
    
</authentication>
    
    
<authorization>
      
<deny users ="?"/>
      
<allow  roles ="admin"/>
    
</authorization>
    
<!--
            如果在执行请求的过程中出现未处理的错误,
            则通过 
<customErrors> 节可以配置相应的处理步骤。具体说来,
            开发人员通过该节可以配置
            要显示的 html 错误页
            以代替错误堆栈跟踪。

        
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            
<error statusCode="403" redirect="NoAccess.htm" />
            
<error statusCode="404" redirect="FileNotFound.htm" />
        
</customErrors>
        
-->
    
<customErrors mode="RemoteOnly" defaultRedirect="Error.aspx">
      
<error statusCode="403" redirect="Error.aspx" />
      
<error statusCode="404" redirect="Error.aspx" />
    
</customErrors>
    
    
<!--  会话状态设置
          默认情况下,ASP.NET 使用 Cookie 来标识哪些请求属于特定的会话。
          如果 Cookie 不可用,则可以通过将会话标识符添加到 URL 来跟踪会话。
         若要禁用 Cookie,请设置 sessionState cookieless
="true"
    
-->
    
<!--在这里设置为True是为了,验证请求过滤,但是False表示没有过滤这样做太不安全了所以一定不要这样,最好的方法是在当前页面添加Page_Error()函数
    
   
protected void Page_Error(object sender, EventArgs e)
    {
            Exception ex 
= Server.GetLastError();
            
if (ex is HttpRequestValidationException)
            {
                Response.Write(
"请您输入合法字符串。");

                Server.ClearError(); 
// 如果不ClearError()这个异常会继续传到Application_Error()。
            }
    }
    
-->
        
<pages validateRequest ="true">
            
<controls>
                
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            
</controls>
        
</pages>
        
<httpHandlers>
            
<remove verb="*" path="*.asmx"/>
            
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
        
</httpHandlers>
        
<httpModules>
            
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        
</httpModules>
    
</system.web>
    
<system.codedom>
        
<compilers>
            
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                
<providerOption name="CompilerVersion" value="v3.5"/>
                
<providerOption name="WarnAsError" value="false"/>
            
</compiler>
            
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                
<providerOption name="CompilerVersion" value="v3.5"/>
                
<providerOption name="OptionInfer" value="true"/>
                
<providerOption name="WarnAsError" value="false"/>
            
</compiler>
        
</compilers>
    
</system.codedom>
    
<!-- 
        在 Internet 信息服务 
7.0 下运行 ASP.NET AJAX 需要 system.webServer
        节。对早期版本的 IIS 来说则不需要此节。
    
-->
    
<system.webServer>
        
<validation validateIntegratedModeConfiguration="false"/>
        
<modules>
            
<remove name="ScriptModule"/>
            
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        
</modules>
        
<handlers>
            
<remove name="WebServiceHandlerFactory-Integrated"/>
            
<remove name="ScriptHandlerFactory"/>
            
<remove name="ScriptHandlerFactoryAppServices"/>
            
<remove name="ScriptResource"/>
            
<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>
    
<runtime>
        
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            
<dependentAssembly>
                
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
                
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            
</dependentAssembly>
            
<dependentAssembly>
                
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
                
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            
</dependentAssembly>
        
</assemblyBinding>
    
</runtime>
</configuration>(责任编辑:admin)
首页 - 技术交流 - 生活感悟 - 影视音乐 - 网址导航 - 图片收藏 - 实用工具 - 网站地图 - 百度地图 - RSS地图
邙山之巅:软件攻城师,互联网砖家,山水田园诗人,著名的思想家,政治家,文学家。
是中华人民共和国合法公民,在计算机软件方面有较高造诣。著有《放羊的那些事》一书,书中描绘了自己童年时代放羊的美好时光,
告诫人们要保护环境,否则以后只能在上海的南京路上放羊了。同时脑细胞异常活跃,经常胡思乱想,目前正在思考如何解决“欧债危机”和“美债危机”这两个世界级难题。
邙山之巅:从小就饱读诗书,学前班连上五年,破世界吉尼斯纪录,因此基础知识功底非常深厚。7岁能够看懂A片,8岁可以腾云吐雾,9岁号称千杯不倒,10岁已然有了一次轰轰烈烈的恋爱。此时此刻,很多东西对他来说早已是风轻云淡。后来考取了美国法克由大学的全能博士学位,成为华人中获得此高等学位的第一人。
在计算机方面的成就:精通C,C++,C#,JAVA,PHP,ASP,VB,DELPHI,ORACLE,MYSQL等。尤其精通网页前后台,设计,DIV+CSS,PHP+MYSQL,js,以及各种流行CMS。
新公司堆积3个月的活,被其一周干完。曾因技术过强,工作效率过高,而遭人嫉妒。 政治学方面成就:成功收复台湾,维护了台海稳定。
经济学方面的成就:帮助世界各国成功度过经济危机,并且成功预测了后经济危机时代的到来。 文学方面的成就:著《放羊的那些事》,以及10篇评论性文章,均未发表或出版。
Copyright ◎ 2012-2022 lixinwei.cn 邙山之巅 版权所有
豫ICP备17045676号-1 给我写信