473,396 Members | 1,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Easily Saving user settings in a c# Windows Forms application

I understand that I am not supposed to alter the .config file for a program
(accessible through the AppSettings[]).

Is there a System class you could recommend that I could use (or even a
class out there somewhere) to easily load and save custom settings for the
current user? My only thought is to maybe use a datatable with "key" and
"value" columns and serialize it through XML in an IsolatedStorageFile - but
this just seems so lame and inelegant.

Suggestions?

- Nevyn
Nov 15 '05 #1
2 2264
Hello,

"Nevyn Twyll" <as****@hotmail.com> schrieb:
I understand that I am not supposed to alter the .config file for a program (accessible through the AppSettings[]).

Is there a System class you could recommend that I could use (or even a
class out there somewhere) to easily load and save custom settings for the
current user? My only thought is to maybe use a datatable with "key" and
"value" columns and serialize it through XML in an IsolatedStorageFile - but this just seems so lame and inelegant.


Application/user settings should not be saved into a config file:

http://www.palmbytes.de/content/dotn...optionslib.htm

HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 15 '05 #2
"Gawelek" <ga*****@NOSPAMEKpoczta.gazeta.pl> wrote in message
news:bi**********@atlantis.news.tpi.pl...
Application/user settings should not be saved into a config file:


Why not ?

<snipped>

Gawel


Three reasons off the top of my head, with regard to user settings...

1) Application Upgrades. Do you really want to deal with maintaining user
settings when you push out version 1.1 of your application which includes an
updated app.config file?

2) Shared Systems. An application is typically installed only once
regardless of the number of people using the computer. If you store User A's
preferences in the app.config, User B will wind-up using the same settings
and have the ability to overwrite those settings with their own preferences.
You would essentially be able to store application preferences only - not
user preferences.

3) Security. In a properly secured system, the user is not running with
admin-level privileges and does not have permission to write to the file
system except to very specific places. An application's install folder is
not one of those specific places. This is one of the purposes of the
IsolatedStorage classes: writing to user-specific locations where you are
guaranteed they have the appropriate permissions.

Ryan LaNeve
Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

138
by: theodp | last post by:
--> From http://www.techdirt.com/articles/20040406/1349225.shtml Microsoft Patents Saving The Name Of A Game Contributed by Mike on Tuesday, April 6th, 2004 @ 01:49PM from the...
13
by: Ron L | last post by:
I have an application we are building that will be used by a number of different users on shared PCs. I want to be able to store a number of user settings in a location that is unique for each...
3
by: cdj | last post by:
Hi all, I've got a picturebox on a form, and a save button. When I go to save, the app craps out with the following error: ================== An unhandled exception of type...
7
by: Dennis C. Drumm | last post by:
Can my program access the HKEY_LOCAL_MACHINE/Software section of the registry when being used by a user with restricted rights (not with admin rights)? If so, how? I have a program that...
8
by: Henry Jones | last post by:
VB.NET Windows Forms VS 2005 I would like to give the user the option of changing the background color of the textbox to anything they want. Can someone provide code how to save the...
2
by: Tal Shachar | last post by:
Hi, I have a windows application that needs to save some user preferences to an xml and to load it on the next application run. Saving the preferences is done per user. I know that there is a way...
3
by: Nathan Guill | last post by:
I have an interface that works with an Access back-end. I would like to store and/or load user defined query strings per each user (i.e. no user can access another's queries). The idea I had was...
1
by: romcab | last post by:
Hi guys, I would like to ask your help about saving in ado.net. I was able to update it only on the display but when I check the database, it is not updated. I paste below my code and hopefully...
1
by: =?Utf-8?B?VGVycnk=?= | last post by:
I am using the My.Settings object to save user settings. During testing, I want to 'zero' out what has been saved to start with the defaults again. Where doies the framwork actually persist these...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.