Click here to Skip to main content
15,903,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi..it is possible to store a data in my project permanently? for example in settings i am saving a value in the run time but after closing the project the saved data is not in the properties settings.
so it is possible to store a constant value in my project in the run time and that value should be available even after i close the project and restart the project.Please provide me the code or process???
Posted
Comments
oliver grace 8-May-14 3:13am    
You can use xml file to store your data.
BELGIUMsky 8-May-14 3:17am    
I've always used settings for this.

did you do something like

Properties.Settings.Default.myColor = Color.AliceBlue

If you want it to be saved in settings you have to do the next line after changing the setting
Properties.Settings.Default.Save();

source: http://msdn.microsoft.com/en-us/library/aa730869(v=vs.80).aspx
Read this link good and you will now how to do this
Prasad Avunoori 8-May-14 4:56am    
Yes, BelgiumSky is correct.

 
Share this answer
 
You can store that value in app.config file

C#
<configuration>
  <appsettings>
    <add key="countoffiles" value="7" />
    <add key="logfilelocation" value="abc.txt" />
  </appsettings>
</configuration>
 
Share this answer
 
Comments
Manivignesh 8-May-14 3:16am    
I am using c# project..i can use this code in the windows application project?
Vi(ky 8-May-14 3:21am    
yes you can
Manivignesh 8-May-14 3:24am    
thanks bro..
Vi(ky 8-May-14 3:25am    
please accept the solution and rate it. :)

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