Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   How to save a class in the settings.settings (http://www.go4expert.com/forums/save-class-settingssettings-t7038/)

morfix78 25Oct2007 18:45

How to save a class in the settings.settings
 
hello,
i have created a class with variables and i would like to know if it is possible to save the class in the settings file so that when the user will run the application i will be able to load the values from the setting.
i created a object in the settings file from the type of the class and i tried to write:
" Properties.Settings.Default.Model = this; //the model is the class
Properties.Settings.Default.Save();"
but when i run the application again the values are not the same as i wanted.
how can i save the values and load them when i run the application again.
thanks

shabbir 25Oct2007 19:42

Re: How to save a class in the settings.settings
 
You need to look at the serialization concept.

morfix78 25Oct2007 19:49

Re: How to save a class in the settings.settings
 
can you please give me more details?
thanks

shabbir 25Oct2007 20:28

Re: How to save a class in the settings.settings
 
see http://www.codeproject.com/csharp/objserial.asp


All times are GMT +5.5. The time now is 23:45.