Where to store user settings in a window application?

Where should I store user settings in a window application? For instance, 
states of checkboxes in some kind of a "options menu", (hashed) password, 
login, etc, etc...
I googled a lot and i found proposals with a storage in registry as well as 
with the storage in a generated file (.xml or .ini?).
What is the best solution?

Thanks in advance. 


0
ask6788 (14)
1/19/2009 1:32:21 PM
dotnet.xml 7266 articles. 0 followers. Follow

5 Replies
1011 Views

Similar Articles

[PageSpeed] 59

Check Application.Settings.  You can specify a property and then bind it to 
a control property like a checkbox or textbox. An optional setting saves any 
changes when you close the application. - Very easy to use.

Rick

"Mazdonat" <ask@me.com> wrote in message 
news:gl1vf9$and$1@news2.carnet.hr...
> Where should I store user settings in a window application? For instance, 
> states of checkboxes in some kind of a "options menu", (hashed) password, 
> login, etc, etc...
> I googled a lot and i found proposals with a storage in registry as well 
> as with the storage in a generated file (.xml or .ini?).
> What is the best solution?
>
> Thanks in advance.
> 

0
Rick2256 (24)
1/19/2009 2:55:15 PM
On 19 sij, 15:55, "Rick" <R...@lakevalleyseed.com> wrote:
> Check Application.Settings. =A0You can specify a property and then bind i=
t to
> a control property like a checkbox or textbox. An optional setting saves =
any
> changes when you close the application. - Very easy to use.
>
> Rick
>

Nice advice!
At this way the data is stored into a .exe.config-file (xml-format)
automatically?
0
1/19/2009 6:31:13 PM
On Jan 19, 10:31=A0am, onoffto...@gmail.com wrote:
> On 19 sij, 15:55, "Rick" <R...@lakevalleyseed.com> wrote:
>
> > Check Application.Settings. =A0You can specify a property and then bind=
 it to
> > a control property like a checkbox or textbox. An optional setting save=
s any
> > changes when you close the application. - Very easy to use.
>
> > Rick
>
> Nice advice!
> At this way the data is stored into a .exe.config-file (xml-format)
> automatically?

Yes, except that it goes into the user profile (Documents and Settings
\<username>\Application Data), under a subdirectory with name derived
from your application name. You can also designate some properties in
the Settings Designer as global, in which case they'll actually go
into your .exe.config (but then of course a non-admin user won't be
able to change them).
0
int19h (6)
1/20/2009 12:44:04 AM
have a look at 
http://www.emoreau.com/Entries/Articles/2007/03/AppSettings-revisited.aspx

-- 

HTH

�ric Moreau, MCSD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc. (http://www.emoreau.com)
Membre du r�seau .NET Expertise  (www.dotnet-expertise.com)



"Mazdonat" <ask@me.com> wrote in message 
news:gl1vf9$and$1@news2.carnet.hr...
> Where should I store user settings in a window application? For instance, 
> states of checkboxes in some kind of a "options menu", (hashed) password, 
> login, etc, etc...
> I googled a lot and i found proposals with a storage in registry as well 
> as with the storage in a generated file (.xml or .ini?).
> What is the best solution?
>
> Thanks in advance.
> 

0
1/22/2009 6:11:05 PM
Mazdonat,

You asked for the best solution (there are much more)

http://msdn.microsoft.com/en-us/library/bdts8hk0.aspx

Cor

"Mazdonat" <ask@me.com> wrote in message 
news:gl1vf9$and$1@news2.carnet.hr...
> Where should I store user settings in a window application? For instance, 
> states of checkboxes in some kind of a "options menu", (hashed) password, 
> login, etc, etc...
> I googled a lot and i found proposals with a storage in registry as well 
> as with the storage in a generated file (.xml or .ini?).
> What is the best solution?
>
> Thanks in advance.
> 

0
1/23/2009 7:38:02 AM
Reply:

Similar Artilces:

Nested If Function to be converted into a user-defined custom function
Dear Experts: below formula (nested if formula) WORKS FINE in EXCEL 2007, but it is not working in 2003 for known reasons (number of conditions exceeding the limit) . I now would like to create a user-defined custom function (UDF) in Excel 2003. I know how to operate the VBA Editor but I got no idea how this nested If-Formula translates into a VBA-code. Could somebody please help me. Help is much appreciated. Thank you very much in advance. Regards, Andreas ------------------------------------------------------------------------------ Below formula (nested IF-Function...

Money Can't Set up a Mortgage Right!
I have issues with Money 2003. I bought a house Nov 2003. I set up the mortgage account and tell it my purchase date. It starts the loan 1/1/2004 because it assumes I have paid Nov interest at closing and won't owe anything until 1/1/2004. This screws up my net worth reports because I had a home asset in Nov 03, but the loan liability doesn't appear until Jan 04. Broken! I can't seem to set the loan date to force it to recognize the Nov loan beginning date. What to do?? Thanks, Ben Money starts the loan in 1/1/2004 because that's the date you told it the first payment...

Change the working directory for a MFC application
I am trying to change the working directory of a MFC application after the application execution begins. Chdir or setcurrentdirectory doesnot work for a MFC application. Can anyone suggest how i can do this? Thanks, - Akila. Akila wrote: > I am trying to change the working directory of a MFC application after > the application execution begins. > > Chdir or setcurrentdirectory doesnot work for a MFC application. > > Can anyone suggest how i can do this? > > Thanks, > - Akila. > SetCurrentDirectory does work for a MFC application. If it doesn't seem ...

Disabling F1 key's Windows Help Function
We'll I guess the title says it all :) Just curious if there is an easy way to disable F1 from always trying to bring up Window's help whenever it is hit within the program. I find it more than a little annoying because even in my program where (I thought) I was capturing all keystrokes for a keyDown event (I added UINT MyClass:OnGetDlgCode() { return DLGC_WANTARROWS|DLGC_WANTALLKEYS|DLGC_WANTCHARS; } Hmmm, so can I add something else to this line perhaps (going to check on this now) in order to catch ALL keystrokes (or at least add something so windows help function will be di...

Problems with re-setting the last active cell in an Excel workshee
I am trying to re-set the last active cell on an Excel 2002 worksheet (in this particular sheet it should be cell DA197). I have used both the methods described in the Knowledge Base article (deleting rows and columns and re-saving; and the Excess Format Cleaner add-in). Deleting the rows and columns does not work; using the Excess Format Cleaner does not work either and it then also hides the rows from 198 to 65536 - but does not do the same for the columns. I have checked that there is no protection on the worksheet. Has anyone else come across this problem and if so can you please ...

Outlook Users
how do i allow different Users to access Outlook at startup? I have two Users on the same Laptop and Outlook starts up without the option of choosing a User. Thank you, "Brads" <Brads@discussions.microsoft.com> wrote in message news:844B7894-D54A-4093-BC4B-A0B817D4C311@microsoft.com... > how do i allow different Users to access Outlook at startup? > I have two Users on the same Laptop and Outlook starts up without the > option > of choosing a User. > Thank you, I'm presuming from this that you only have one Windows log-in on this laptop? The answer, un...

How can I list active OWA users
We have two front end Exchange servers running Exchange 2003. I need to list the active OWA connections on each server. What is the best way to do this? Thanks in advance MikeC MikeC <MikeC@discussions.microsoft.com> wrote: >We have two front end Exchange servers running Exchange 2003. I need to list >the active OWA connections on each server. What is the best way to do this? Use WMI? -- Rich Matheisen MCSE+I, Exchange MVP MS Exchange FAQ at http://www.swinc.com/resource/exch_faq.htm Don't send mail to this address mailto:h.pott@getronics.com Or to these, either: ma...

Windows Live Messenger doesn't "remember" me
Hi All, My Windows Live Messenger doesn't "remember" my username/ID. I click remember me and then when having signed off I restart it or the computer again, it doesn't "remember" me. Help! ...

Estimating application memory requirements
Our company has an app that is heavily dependent Sqlserver. Our test server is 64 bit with 32gb of RAM. I am hoping to find a minimum amount of RAM to recommend to our clients. If i set the MAX server memory value low and then increase that value with the same load, and watch the Sql memory stats will i be able to find the point at which more memory to the process isn't adding value? i am using this for performance counter values http://www.sqlservercentral.com/articles/Performance+Tuning/analyzingmemoryrequirementsforsqlserver/2498/ which looks a lot like this one htt...

Users and Asset Data linked on Form
Hello everyone, I have two tables, one a Staff list and the other an Asset list extracted from seperate databases, the information in the tables has absolutely no common data, I have a form with the user name and other bits and pieces on from the staff list and also a drop down list of all asset numbers which I can then select the appropiate asset number from then, that asset number and other details I would like to be associated to that user. I have tried, I have done this in the past about 4 years ago but I cannot remember any of it! Any help would most appreciated Cheers David David, T...

Set the line weight with VBA in Excel 07
I applied a chart style to a chart. I had the macro recorder on while I manipulated the chart. I saw the code to change the default size of the marker, but I could not get any code to appear for adjusting the line weight of the data series while a chart style is applied. I looked in the series object model and don't see a property by which to set the line weight. The old Border property in 03 is gone. How should I adjust this programatically? Thanks. TL Hi, Try, activechart.SeriesCollection(1).format.line.weight=3 Cheers Andy TroyLee wrote: > I applied a chart style to a c...

How to set right margin in the Endnotes in Word?
I need to set the right margin in the endnotes in Word 2007. If you want the notes to have a different margin from the page, you can apply an indent (positive or negative) to the Endnote Text style. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "Ounbbl" <Ounbbl@discussions.microsoft.com> wrote in message news:826849B3-FED1-411D-906E-489FB29F1A00@microsoft.com... >I need to set the right margin in the endnotes in Word 2007. > ...

Exporting e-mail account settings
I want to transfer all my account settings to another computer, also running Outlook 2003. How do I do this? Many thanks Tony Not sure what operating system you are using, but I tend to using Windows XP's Files and Setting Transfer Wizard and Microsoft Office's 2003 Save My Settings Wizard to transfer settings from one system to the next. Another possibility is the user state migration tool. http://www.microsoft.com/downloads/details.aspx?FamilyId=4AF2D2C9-F16C-4C52-A203-8DAF944DD555&displaylang=en "Tony Rush" <NOtony_w_rushSPAM@btopenworld.com> wrote i...

Windows Live Mail (news)?
Hi, I am only using WLM and nothing else from Windows Live-id I see that on my PC there is also WLM(news). First question: How can i remove it ? Second question: I see that after start-up (or after stand-by) and immediately going to WLM often my connection to my provider fails ? Although and immediate connection with IE8 never fails and is very quick. Waiting a few seconds to activate WLM is aways ok and messages are read normally. Who can give any advice? Regards Huib Alt + T, Options, Connection, uncheck Hang up after sending and receiving. -- Ron Somm...

How? Default is current date, but user can edit if needed?
I want Start Date field to default to the current date, but allow the user to change it if needed. Start Date field has a format of Short Date with a mask __/__/__. The boss wants the field to default to the current date to eliminate keystrokes for the user. Scenario: User forgot to input data yesterday that must reflect yesterday's date. How can the field be formatted to allow the user to change the Start Date field if the field defaults to current date? When a field has a default value, it can be changed as you want. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele...

ExMerge stops working until I backup information store
I use ExMerge to archive mailboxes of people who leave the company and about 80 percent of the time if works fine. But every now and then I get a failure with the log saying it was unable to open the message store. Despite having the correct permissions, it will continue to fail until I back up the mailbox store and then it works fine again. Can anyone explain to me what the backup is doing that then allows ExMerge to work. Thanks, Jan i never heard of anything like that before...are these accounts disabled? are you re-enabling them? -- Susan Conkey [MVP] "Jan" <user...

page settings in Business Portal
We have a customer who wants to print the time sheet in landscape (page orientation); currently there are two ways of achieving it: 1. Change the printer settings (Control Panel > Printers and Faxes > Select printer; right click and choose properties > Printing preferences of General Tab > Advance tab). This would set the printer to the desired page orientation size; however, all documents that will be printed on the said printer will use the settings made. 2. On the Business Portal page go to File > Page Setup; choose the page orientation and size desired. The effect ...

moving users to new cluster server
I would like to start migrating all my users about 400 mailboxes from one server with 1 storage group and 5 databases to a cluster server with 2 storage groups and 3 databases each. Should I go with the move mailbox method? What is the best way to do this? On Thu, 8 Mar 2007 09:28:13 -0800, "mcp" <none@none.com> wrote: >I would like to start migrating all my users about 400 mailboxes from one >server with 1 storage group and 5 databases to a cluster server with 2 >storage groups and 3 databases each. Should I go with the move mailbox >method? What is the ...

Can Windows client application read/write data to remote SQL Server database?
Can a Windows client application read/write data to a remote SQL Server database? > Can a Windows client application read/write data to a remote SQL > Server database? Certainly. SQL Server is a client-server DBMS and the service often runs remotely on a separate server. -- Hope this helps. Dan Guzman SQL Server MVP http://weblogs.sqlteam.com/dang/ ...

Set Discount limit
Dear All, I would like to set discount limit for cashiers in RMS POS, (15%) for example. Thanks in advance, Ibrahim Zubair I would like to have that option as well, but (as far as I know) it's not possible in RMS 2.0 "Ibrahim Zubair" <IbrahimZubair@discussions.microsoft.com> wrote in message news:7A5693D5-A4D3-4EF0-AD76-67E1BAF7CD95@microsoft.com... > Dear All, > > I would like to set discount limit for cashiers in RMS POS, (15%) for > example. > > Thanks in advance, > > Ibrahim Zubair ...

SOP Invoice: Custom footer based on logged in user or customer cla
I've been asked to determine if its possible to conditionally print footers on SOP Invoices to indicate the contact info of the person responsible for the client company. I was looking at either using the current logged in user or the class of the customer to determine which info to include. Can anyone point me to a KB article or some other source that can show me how to do this? Unforunately the user-defined fields in the customer record have already been dedicated to something else. TIA! VinceV You can attach some VBA code to the report and use the RetrieveGlobals.dll supplie...

Strange problem while running MFC 7.0 apps on Windows 2000
Hello, I'm writing an MFC 7.1 program and it runs smoothly on XP and 98. However, on Windows 2000 I encountered a strange message saying that The application failed to initailize properly (0xc0000005). Click on OK to terminate the application. Thus I try to install VS.Net 2003 on a Win2k machine and run my EXE from VS.Net IDE. The debugging outputs are attached below. Any clues / suggestions / solutions are appreciated. My program uses VS.Net 2003 (MFC 7.1, link as static library) and CImage class in that. The GDIPlus.dll is copied from .Net framework 1.1.3705. TIA, Arthur ...

Set report criteria in code?
Is it possible to set a reports criteria in code? I am trying to use Stephen Lebans report-to-pdf tool, which uses the report as a parameter. I need to specify a criteria for the report, like I do when I open the report for printing: DoCmd.OpenReport strReportName, acViewNormal, , strReportParam I don't see how to set report criteria in the report-to-pdf tool, but if I can set the criteria before I use the tool, that should work. Thanks in advance for any help. Fred I haven't used Stephens solution but you can always use a little DAO code to dynamically change...

How do I set up MSN account and yahoo, it keeps saying error.
I have tried everything and it keeps saying server not available? please help. misty <misty@discussions.microsoft.com> wrote: > I have tried everything and it keeps saying server not available? > please help. MSN's and Yahoo's Help pages contain the details. -- Brian Tillman With Misty being as vague as she was in the problem statement, how can you be sure, Brian, that the help she needs is in the help pages? "misty" <misty@discussions.microsoft.com> wrote in message news:54858363-0A1B-4FAF-8B6B-AD5B0C824BFD@microsoft.com... >I have tried every...

Set specified dimensions for web ad
I need to create a 3.5 x 3.5 web ad with these requested dimensions: 252 pixels at 72 dpi x 252 pixels at 72 dpi. I can get the 252 pixel square, but I'm having trouble with the 72 dpi. The ad will contain an image that I can currently only get down to 96 dpi by using the "Change Picture" button. Any help would be most appreciated. Thanks!!! Whitney wrote: > I need to create a 3.5 x 3.5 web ad with these requested dimensions: 252 > pixels at 72 dpi x 252 pixels at 72 dpi. I can get the 252 pixel square, but > I'm having trouble with the 72 dpi. The ad wil...