zoukankan      html  css  js  c++  java
  • 配置信息

    <?xml version="1.0"?>
    <configuration>
    
      <configSections>
        <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
      </configSections>
    
      <log4net>
        <root>
          <level value="ALL"/>
          <appender-ref ref="LogFileAppender"/>
        </root>
        <logger name="logger">
          <level value="DEBUG"/>
          <appender-ref ref="LogFileAppender"/>
        </logger>
        <appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender,log4net">
          <param name="AppendToFile" value="true" />
          <param name="RollingStyle" value="Date" />
          <param name="DatePattern" value="yyyyMMdd" />
          <param name="StaticLogFileName" value="false" />
          <param name="File" type="" value="log\log" />
    
          <layout type="log4net.Layout.PatternLayout">
            <param name="Header" value="&#xD;&#xA;=======================Header=======================&#xD;&#xA;" />
            <param name="Footer" value="xD;&#xA;=======================Footer=======================&#xD;&#xA;" />
            <param name="ConversionPattern" value="%d [%t] %-5p %c [%x]  - %m%n"/>
          </layout>
        </appender>
      </log4net>
    
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
      </startup>
    
      <!--WCF-->
      <appSettings>
        <add key="connStr" value="Data Source=XXX;Initial Catalog=XXX;User Id=XXX;Password=XXX"/>
      </appSettings>
    
      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="userBllEndPoint" closeTimeout="00:01:00" openTimeout="00:01:00"
              receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
              bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
              maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
              messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
              useDefaultWebProxy="true">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
            </binding>
            <binding name="examBllEndPoint" closeTimeout="00:01:00" openTimeout="00:01:00"
              receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
              bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
              maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
              messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
              useDefaultWebProxy="true">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
            </binding>
          </basicHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://localhost:2001/UserBll" binding="basicHttpBinding"
            bindingConfiguration="userBllEndPoint" contract="UserBllService.IUserBll"
            name="userBllEndPoint" />
          <endpoint address="http://localhost:2002/ExamBll" binding="basicHttpBinding"
            bindingConfiguration="examBllEndPoint" contract="ExamBllService.IExamBll"
            name="examBllEndPoint" />
        </client>
      </system.serviceModel>
    
    </configuration>
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <connectionStrings>
        <add name="connStr" connectionString="Data Source=XXX;Initial Catalog=XXX;User Id=XXX;Password=XXX" providerName="System.Data.SqlClient"/>
      </connectionStrings>
    </configuration>

    读取:

            public static SqlConnection GetConnection()
            {
                string connStr = ConfigurationManager.AppSettings["connStr"];
                SqlConnection conn = new SqlConnection(connStr);
                return conn;
            }

    读取:

  • 相关阅读:
    吴裕雄--天生自然 python语言数据分析:开普勒系外行星搜索结果分析
    吴裕雄--天生自然 R语言数据分析:火箭发射的地点、日期/时间和结果分析
    吴裕雄--天生自然 PYTHON数据分析:基于Keras的CNN分析太空深处寻找系外行星数据
    吴裕雄--天生自然 python数据分析:基于Keras使用CNN神经网络处理手写数据集
    吴裕雄--天生自然 PYTHON数据分析:钦奈水资源管理分析
    吴裕雄--天生自然 PYTHON数据分析:医疗数据分析
    独家解密:阿里大规模数据中心性能分析
    日志服务Python消费组实战(三):实时跨域监测多日志库数据
    日志服务Python消费组实战(二):实时分发数据
    日志服务与SIEM(如Splunk)集成方案实战
  • 原文地址:https://www.cnblogs.com/chenyongblog/p/3817381.html
Copyright © 2011-2022 走看看