app.config

<?xml version="1.0" encoding="utf-8" ?>


<configuration>
  <configSections>
    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
      <section name="MarinerERP.Server.Host.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
    </sectionGroup>
  </configSections>


  <connectionStrings>
    <add name=”dbconnection" connectionString="Data Source=SERVER;Initial Catalog=디비" providerName="System.Data.SqlClient"/>
    </connectionStrings>
  <userSettings>
    <Test.Server.Host.Properties.Settings>
      <setting name="Setting" serializeAs="String">
        <value>테스트1</value>
      </setting>
       </Test.Server.Host.Properties.Settings>
  </userSettings>
</configuration>

 

cs 소스

string DBconn = ConfigurationManager.ConnectionStringsTest.Server.Host.Properties.Settings"].ConnectionString;


string Settions1 = MarinerERP.Server.Host.Properties.Settings.Default["Setting"].ToString();

+ Recent posts