Click here to Skip to main content
15,904,288 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

At design time, one could easily define variables in setting tab (which could be accessed from Project -> properties... -> Settings) of program. What I need to know is, how to write to or read from the associated file (located at properties folder of program, in file "Settings.settings" or also called as "Settings-Designer" file) at runtime. Could you please help me through example?

Thanks a lot
Posted

I wish all questions were as easy as this one :) :
http://msdn.microsoft.com/en-us/library/aa730869(VS.80).aspx[^]

Cheers
 
Share this answer
 
Comments
ahhashemi 15-Aug-10 14:38pm    
Reason for my vote of 5
Dear Estys

Thanks a lot for your helpful guide. I'm glad that
I could satisfy your desire of asking a piece of a cake question
You access the setting's properties through Properties.Settings.Default where they can be read or written to. If you change them and wish to persist for future, call Properties.Settings.Default.Save();
 
Share this answer
 
Comments
Per Söderlund 15-Aug-10 14:06pm    
and make sure you set Scope to User and not application.
ahhashemi 15-Aug-10 14:39pm    
Reason for my vote of 5
the answer is what i was looking for

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900