If you are using visual studio.
add a config file to your solution.
in that file put your entries like this
<configuration>
<appSettings>
<add key="ExportPath" value="C:\\Tmp" />
</appSettings>
</configuration>
and use this
string Exportpath=
CStr(System.Configuration.ConfigurationSettings.AppSettings("ExportPath"))
Bye
Kishor Pise
> In Properties / Settings, I've got a setting (say "ExportPath") with a value
> (say "C:\\Tmp").
>
> Using C#, how do you get the setting value?
>
> string settingValue = SomeNETWhatever["ExportPath"];
Jim Rand - 12 Jul 2006 17:57 GMT
After much time, I've figured it out how to read the application settings
created in the designer:
Configuration config =
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
ConfigurationSectionGroup configGroup =
config.SectionGroups["applicationSettings"];
ClientSettingsSection settingsSection = (ClientSettingsSection)
configGroup.Sections["AppSettings.Properties.Settings"];
SettingElementCollection elements = settingsSection.Settings;
foreach (SettingElement element in elements)
{
txtOutput.Text += element.Name + ":" + element.Value.ValueXml.InnerText
+ Environment.NewLine;
}
A simpler approach is just to use the AppSettings that you suggested.
Jim
> If you are using visual studio.
> add a config file to your solution.
[quoted text clipped - 21 lines]
>>
>> string settingValue = SomeNETWhatever["ExportPath"];