1. Save the the following config file
as
c:\ohad.config
<?xml version=
"1.0"
encoding=
"utf-8"
?>
<configuration>
<appSettings>
<add key=
"name"
value=
"the value"
/>
</appSettings>
</configuration>
2. Create a simple windows forms application and paste the following lines:
AppDomain.CurrentDomain.SetData(
"APP_CONFIG_FILE"
,
"c:\\ohad.config"
);
string
s=System.Configuration.ConfigurationSettings.AppSettings[
"name"
];
MessageBox.Show(s);