Adding configuration file in a 3 tier architecture

1.Add a single app.config file in the UI Layer
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>

    <add key="Server1" value="10.250.1.32" />
    <add key=" Server 2" value="10.251.1.54" />
   
   </appSettings>
</configuration>

1.      Add the system.configuration dll refererence to the projetc where you want to access these values
using System.Configuration;
//access values using below code
String ipaddress= ConfigurationSettings.AppSettings.Get("MDT1");

2 comments:

  1. Play online casino games online with the best bonuses and
    Join the new best online casinos, 바카라 사이트 where you can 메리트카지노 play free slots or 온카지노 real money casino games online. Get the best bonuses and free spins.

    ReplyDelete