Search:
Namespaces
Discussions
.NET v1.1
Feedback
saving settings
Messages
Related Types
This message was discovered on
ASPFriends.com 'winforms-cs' list
.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
dave wanta (VIP)
hi all,
I have a winform application that will allow the user to save their settings. The settings are basically 10 - 15 different textboxes on a form. This will allow them to enter different default settings and create different profiles. What is the best way to save these settings? I'm assuming a xml .config file but what is the quickest way of reading\writing xml files out? Every xml example i've done gets rather lengthy. Does anyone have any quick and easy examples for reading\writing xml files?
Thanks,
dave
Reply to this message...
Andy Smith
IMO, the easiest way is to just write a Preferences object that can be serialized.
__
Andy Smith
Chief Code Monkey
-----Original Message-----
From: dave wanta [mailto:
Click here to reveal e-mail address
]
Sent: Tuesday, May 21, 2002 1:03 PM
To: winforms-cs
Subject: [winforms-cs] saving settings
hi all,
I have a winform application that will allow the user to save their settings. The settings are basically 10 - 15 different textboxes on a form. This will allow them to enter different default settings and create different profiles. What is the best way to save these settings? I'm assuming a xml .config file but what is the quickest way of reading\writing xml files out? Every xml example i've done gets rather lengthy. Does anyone have any quick and easy examples for reading\writing xml files?
Thanks,
dave
| [winforms-cs] member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/winforms-cs.asp
= JOIN/QUIT
Reply to this message...
Chris Longo
ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpconintroducingxmlserializatio
n.htm
this should help
-----Original Message-----
From: dave wanta [mailto:
Click here to reveal e-mail address
]
Sent: Tuesday, May 21, 2002 3:03 PM
To: winforms-cs
Subject: [winforms-cs] saving settings
hi all,
I have a winform application that will allow the user to save their
settings. The settings are basically 10 - 15 different textboxes on a
form. This will allow them to enter different default settings and
create different profiles. What is the best way to save these settings?
I'm assuming a xml .config file but what is the quickest way of
reading\writing xml files out? Every xml example i've done gets rather
lengthy. Does anyone have any quick and easy examples for
reading\writing xml files?
Thanks,
dave
| [winforms-cs] member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/winforms-cs.asp
= JOIN/QUIT
Reply to this message...
Glavich, Paul C
An .XML config file is the standard way to go, and there are many ways to
save elements to XML files. Because its only a prefs file, choose whichever
method is easiest for you. You could then easily read the settings using the
"ConfigurationSettings.AppConfig" properties or
"ConfigurationSettings.GetConfig" method to easily access your applocations
config file. Its also standard practice to name your XML file as
{your_exe_filename}.config.
Although, a serializable preferences object would also be a nice way of
doing things, probably a bit more work though.
* Paul Glavich
Professional Web Services
Email: <mailto:
Click here to reveal e-mail address
>
Click here to reveal e-mail address
(Currently no fixed phone or street address)
-----Original Message-----
From: dave wanta [mailto:
Click here to reveal e-mail address
]
Sent: Wednesday, 22 May 2002 5:03 AM
To: winforms-cs
Subject: [winforms-cs] saving settings
hi all,
I have a winform application that will allow the user to save their
settings. The settings are basically 10 - 15 different textboxes on a form.
This will allow them to enter different default settings and create
different profiles. What is the best way to save these settings? I'm
assuming a xml .config file but what is the quickest way of reading\writing
xml files out? Every xml example i've done gets rather lengthy. Does anyone
have any quick and easy examples for reading\writing xml files?
Thanks,
dave
| [winforms-cs] member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/winforms-cs.asp
= JOIN/QUIT
Reply to this message...
dave wanta (VIP)
yes...
i've used that technique before.. forgot how easy it was.
However, one of the values that I need to save is formatted HTML from a
RichTextBox
, and for some reason when I fill the RRB with an html document, the
XmlSerializer
doesn't write it out... It doesn't cause any error, it just never creates the file. I step through the code, and nothing breaks.
Anyone seen this?
thanks,
dave
----- Original Message -----
From: Chris Longo
To: winforms-cs
Sent: Tuesday, May 21, 2002 2:39 PM
Subject: [winforms-cs] RE: saving settings
ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpconintroducingxmlserialization.htm
this should help
-----Original Message-----
From: dave wanta [mailto:
Click here to reveal e-mail address
]
Sent: Tuesday, May 21, 2002 3:03 PM
To: winforms-cs
Subject: [winforms-cs] saving settings
hi all,
I have a winform application that will allow the user to save their settings. The settings are basically 10 - 15 different textboxes on a form. This will allow them to enter different default settings and create different profiles. What is the best way to save these settings? I'm assuming a xml .config file but what is the quickest way of reading\writing xml files out? Every xml example i've done gets rather lengthy. Does anyone have any quick and easy examples for reading\writing xml files?
Thanks,
dave
| [winforms-cs] member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/winforms-cs.asp
= JOIN/QUIT
| [winforms-cs] member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/winforms-cs.asp
= JOIN/QUIT
Reply to this message...
dave wanta (VIP)
Messageyes...
except the <exe>.config file won't work for this situation...
i need to allow for different profiles of seetings.. plus one text box actually contains file contents.. which i'm having trouble serializing out...
----- Original Message -----
From: Glavich, Paul C
To: winforms-cs
Sent: Tuesday, May 21, 2002 5:35 PM
Subject: [winforms-cs] RE: saving settings
An .XML config file is the standard way to go, and there are many ways to save elements to XML files. Because its only a prefs file, choose whichever method is easiest for you. You could then easily read the settings using the "ConfigurationSettings.AppConfig" properties or "ConfigurationSettings.GetConfig" method to easily access your applocations config file. Its also standard practice to name your XML file as {your_exe_filename}.config.
Although, a serializable preferences object would also be a nice way of doing things, probably a bit more work though.
a Paul Glavich
Professional Web Services
Email:
Click here to reveal e-mail address
(Currently no fixed phone or street address)
-----Original Message-----
From: dave wanta [mailto:
Click here to reveal e-mail address
]
Sent: Wednesday, 22 May 2002 5:03 AM
To: winforms-cs
Subject: [winforms-cs] saving settings
hi all,
I have a winform application that will allow the user to save their settings. The settings are basically 10 - 15 different textboxes on a form. This will allow them to enter different default settings and create different profiles. What is the best way to save these settings? I'm assuming a xml .config file but what is the quickest way of reading\writing xml files out? Every xml example i've done gets rather lengthy. Does anyone have any quick and easy examples for reading\writing xml files?
Thanks,
dave
| [winforms-cs] member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/winforms-cs.asp
= JOIN/QUIT | [winforms-cs] member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/winforms-cs.asp
= JOIN/QUIT
Reply to this message...
Andy Smith
I suggest you look at
IsolatedStorage
for the location to put it.
__
Andy Smith
Chief Code Monkey
-----Original Message-----
From: dave wanta [mailto:
Click here to reveal e-mail address
]
Sent: Tuesday, May 21, 2002 4:57 PM
To: winforms-cs
Subject: [winforms-cs] RE: saving settings
yes...
except the <exe>.config file won't work for this situation...
i need to allow for different profiles of seetings.. plus one text box actually contains file contents.. which i'm having trouble serializing out...
----- Original Message -----
From: Glavich, <mailto:
Click here to reveal e-mail address
> Paul C
To: winforms-cs <mailto:
Click here to reveal e-mail address
>
Sent: Tuesday, May 21, 2002 5:35 PM
Subject: [winforms-cs] RE: saving settings
An .XML config file is the standard way to go, and there are many ways to save elements to XML files. Because its only a prefs file, choose whichever method is easiest for you. You could then easily read the settings using the "ConfigurationSettings.AppConfig" properties or "ConfigurationSettings.GetConfig" method to easily access your applocations config file. Its also standard practice to name your XML file as {your_exe_filename}.config.
Although, a serializable preferences object would also be a nice way of doing things, probably a bit more work though.
* Paul Glavich
Professional Web Services
Email: <mailto:
Click here to reveal e-mail address
>
Click here to reveal e-mail address
(Currently no fixed phone or street address)
-----Original Message-----
From: dave wanta [mailto:
Click here to reveal e-mail address
]
Sent: Wednesday, 22 May 2002 5:03 AM
To: winforms-cs
Subject: [winforms-cs] saving settings
hi all,
I have a winform application that will allow the user to save their settings. The settings are basically 10 - 15 different textboxes on a form. This will allow them to enter different default settings and create different profiles. What is the best way to save these settings? I'm assuming a xml .config file but what is the quickest way of reading\writing xml files out? Every xml example i've done gets rather lengthy. Does anyone have any quick and easy examples for reading\writing xml files?
Thanks,
dave
| [winforms-cs] member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/winforms-cs.asp
= JOIN/QUIT | [winforms-cs] member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/winforms-cs.asp
= JOIN/QUIT
| [winforms-cs] member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/winforms-cs.asp
= JOIN/QUIT
Reply to this message...
Glavich, Paul C
Bummer. How about a dataset as the underlying datastorage, using multiple
tables with the same structure, perhaps just name them according to the user
id or some other unique value and as datasets can serialise themselves, you
just need to find the correct location to do so.
Might be a bit too much overhead though.
* Paul Glavich
Professional Web Services
Email: <mailto:
Click here to reveal e-mail address
>
Click here to reveal e-mail address
(Currently no fixed phone or street address)
-----Original Message-----
From: dave wanta [mailto:
Click here to reveal e-mail address
]
Sent: Wednesday, 22 May 2002 8:57 AM
To: winforms-cs
Subject: [winforms-cs] RE: saving settings
yes...
except the <exe>.config file won't work for this situation...
i need to allow for different profiles of seetings.. plus one text box
actually contains file contents.. which i'm having trouble serializing
out...
----- Original Message -----
From: Glavich, Paul <mailto:
Click here to reveal e-mail address
> C
To: winforms-cs <mailto:
Click here to reveal e-mail address
>
Sent: Tuesday, May 21, 2002 5:35 PM
Subject: [winforms-cs] RE: saving settings
An .XML config file is the standard way to go, and there are many ways to
save elements to XML files. Because its only a prefs file, choose whichever
method is easiest for you. You could then easily read the settings using the
"ConfigurationSettings.AppConfig" properties or
"ConfigurationSettings.GetConfig" method to easily access your applocations
config file. Its also standard practice to name your XML file as
{your_exe_filename}.config.
Although, a serializable preferences object would also be a nice way of
doing things, probably a bit more work though.
* Paul Glavich
Professional Web Services
Email: <mailto:
Click here to reveal e-mail address
>
Click here to reveal e-mail address
(Currently no fixed phone or street address)
-----Original Message-----
From: dave wanta [mailto:
Click here to reveal e-mail address
]
Sent: Wednesday, 22 May 2002 5:03 AM
To: winforms-cs
Subject: [winforms-cs] saving settings
hi all,
I have a winform application that will allow the user to save their
settings. The settings are basically 10 - 15 different textboxes on a form.
This will allow them to enter different default settings and create
different profiles. What is the best way to save these settings? I'm
assuming a xml .config file but what is the quickest way of reading\writing
xml files out? Every xml example i've done gets rather lengthy. Does anyone
have any quick and easy examples for reading\writing xml files?
Thanks,
dave
| [winforms-cs] member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/winforms-cs.asp
= JOIN/QUIT | [winforms-cs]
member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/winforms-cs.asp
= JOIN/QUIT
| [winforms-cs] member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/winforms-cs.asp
= JOIN/QUIT
Reply to this message...
System.Configuration.ConfigurationSettings
System.IO.IsolatedStorage.IsolatedStorage
System.Windows.Forms.RichTextBox
System.Xml.Serialization.XmlSerializer
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com