471,319 Members | 3,302 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

Need ConfigurationManager example code

Hi all, having a real struggle using the ConfigurationManager class, i
want to be able to save user specific information to the configuration
file, i try to use:

Configuration config =
ConfigurationManager.OpenExeConfiguration(Configur ationUserLevel.PerUserRoamingAndLocal);

config.AppSettings.Settings.Add("KeyTest", "KeyValue");
//config.SaveAs(config.FilePath);
config.Save();

But it crashes because the config.FilePath doesnt exist (neither does
the directory that the file is supposedly in).

(The config.FilePath = C:\Documents and Settings\<me>\Local
Settings\Application
Data\<app>\<app>.vshost.exe_Url_aif3rzcpslr4ltlzn5 wf5dznoaxbcaxf\1.0.0.0\user.config)


What im trying to do is save application specific data (such as server
to connect to) in the application directory, then user specific data
such as window colours in the application data folders.

How can i do this?

Thanks,

Mark
Jan 16 '06 #1
0 9000

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Michael Debus | last post: by
1 post views Thread by shapper | last post: by
3 posts views Thread by Mark | last post: by
4 posts views Thread by Jim in Arizona | last post: by
3 posts views Thread by Jonathan Wood | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.