473,887 Members | 2,327 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is the current preferred way to save user preferences in dotnet?

What is the current preferred way to save user preferences in dotnet? Is the
registry the right place to do this? Can anyone recommend a good article (or
book) for this topic? Thanks.
Nov 15 '05 #1
41 3464
"Mountain Bikn' Guy" <vc@attbi.com > wrote in message
news:K2rvb.1992 58$mZ5.1480585@ attbi_s54...
What is the current preferred way to save user preferences in dotnet? Is the registry the right place to do this? Can anyone recommend a good article (or book) for this topic? Thanks.


For a desktop app, save information in per-user registry keys, or in XML
files kept in per-user folders. I have some discussion about this in my
book, but frankly the documentation for the methods is fairly
straightforward . See the help on Application.Use rAppDataPath and
Application.Use rAppDataRegistr y. Keep in mind that new folders and registry
keys will be generated for each version of your app that writes to these
locations, so you'll want to start managing your version numbers before you
start using these properties.

--
Mickey Williams
Author, "Microsoft Visual C# .NET Core Reference", MS Press
www.servergeek.com


Nov 15 '05 #2
My preference is to define a class that holds them all and then serialize it
out to a file in the per-user directory
(Environment.Ge tFolderPath(Spe cialFolder.Appl ication) is the location).

That seems to work nicely.

--
Eric Gunnerson

Visit the C# product team at http://www.csharp.net
Eric's blog is at http://blogs.gotdotnet.com/ericgu/

This posting is provided "AS IS" with no warranties, and confers no rights.
"Mountain Bikn' Guy" <vc@attbi.com > wrote in message
news:K2rvb.1992 58$mZ5.1480585@ attbi_s54...
What is the current preferred way to save user preferences in dotnet? Is the registry the right place to do this? Can anyone recommend a good article (or book) for this topic? Thanks.

Nov 15 '05 #3
Momento

"Eric Gunnerson [MS]" <er****@online. microsoft.com> wrote in message
news:u6******** ******@TK2MSFTN GP12.phx.gbl...
My preference is to define a class that holds them all and then serialize it out to a file in the per-user directory
(Environment.Ge tFolderPath(Spe cialFolder.Appl ication) is the location).

That seems to work nicely.

--
Eric Gunnerson

Visit the C# product team at http://www.csharp.net
Eric's blog is at http://blogs.gotdotnet.com/ericgu/

This posting is provided "AS IS" with no warranties, and confers no rights. "Mountain Bikn' Guy" <vc@attbi.com > wrote in message
news:K2rvb.1992 58$mZ5.1480585@ attbi_s54...
What is the current preferred way to save user preferences in dotnet? Is

the
registry the right place to do this? Can anyone recommend a good article

(or
book) for this topic? Thanks.


Nov 15 '05 #4
Thanks. I'll get a copy of your book. It's one of the few C# books I don't
already have. I guess I just needed an excuse to get it and you just gave me
a good one. ;)

(Notice to authors: in exhange for really good and quick replies to my
posts, I'll purchase a copy of your book. How's that for a deal? ;)

However, in this case I think I'll use Eric's suggestion for saving user
preferences. (...I already have Eric's book. It's one of my favorites.)

Regards,
Mountain

P.S. The book I'm most excited about reading next is "Build Your Own .Net
Language and Compiler" by Edward G. Nilges, Josef Finsel

"Mickey Williams" <my first name at servergeek.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
"Mountain Bikn' Guy" <vc@attbi.com > wrote in message
news:K2rvb.1992 58$mZ5.1480585@ attbi_s54...
What is the current preferred way to save user preferences in dotnet? Is the
registry the right place to do this? Can anyone recommend a good article

(or
book) for this topic? Thanks.


For a desktop app, save information in per-user registry keys, or in XML
files kept in per-user folders. I have some discussion about this in my
book, but frankly the documentation for the methods is fairly
straightforward . See the help on Application.Use rAppDataPath and
Application.Use rAppDataRegistr y. Keep in mind that new folders and

registry keys will be generated for each version of your app that writes to these
locations, so you'll want to start managing your version numbers before you start using these properties.

--
Mickey Williams
Author, "Microsoft Visual C# .NET Core Reference", MS Press
www.servergeek.com

Nov 15 '05 #5
"Mountain Bikn' Guy" <vc@attbi.com > wrote in message news:<cYLvb.209 194$ao4.744288@ attbi_s51>...
Thanks. I'll get a copy of your book. It's one of the few C# books I don't
already have. I guess I just needed an excuse to get it and you just gave me
a good one. ;)

(Notice to authors: in exhange for really good and quick replies to my
posts, I'll purchase a copy of your book. How's that for a deal? ;)

However, in this case I think I'll use Eric's suggestion for saving user
preferences. (...I already have Eric's book. It's one of my favorites.)

Regards,
Mountain

P.S. The book I'm most excited about reading next is "Build Your Own .Net
Language and Compiler" by Edward G. Nilges, Josef Finsel
Josef had the idea and I am in his debt. He is a real nice guy who
already has some great books to his credit, and I urge you to look up
his work on Amazon, including The Reluctant Data Base Administrator's
Handbook. It is a book for a programmer who's been told by his manager
that he is now a DBA.

But Josef had to bail out of the actual writing of the book and I am
finishing it up for release early next year. I have written a compiler
for most of Quick Basic and spend the meat of the book in explaining
how that's done, using object oriented techniques, recursive descent,
and BNF.

I use Visual Basic and not C# to appeal to a wide audience.
"Mickey Williams" <my first name at servergeek.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
"Mountain Bikn' Guy" <vc@attbi.com > wrote in message
news:K2rvb.1992 58$mZ5.1480585@ attbi_s54...
What is the current preferred way to save user preferences in dotnet? Is the registry the right place to do this? Can anyone recommend a good article (or book) for this topic? Thanks.


For a desktop app, save information in per-user registry keys, or in XML
files kept in per-user folders. I have some discussion about this in my
book, but frankly the documentation for the methods is fairly
straightforward . See the help on Application.Use rAppDataPath and
Application.Use rAppDataRegistr y. Keep in mind that new folders and

registry
keys will be generated for each version of your app that writes to these
locations, so you'll want to start managing your version numbers before

you
start using these properties.

--
Mickey Williams
Author, "Microsoft Visual C# .NET Core Reference", MS Press
www.servergeek.com

Nov 15 '05 #6
>
I use Visual Basic and not C# to appeal to a wide audience.

rats
Nov 15 '05 #7
Yes by using VB you are sure to attract C# coders!! GENIUS!
"Edward G. Nilges" <sp*********@ya hoo.com> wrote in message
news:f5******** *************** ***@posting.goo gle.com...
"Mountain Bikn' Guy" <vc@attbi.com > wrote in message

news:<cYLvb.209 194$ao4.744288@ attbi_s51>...
Thanks. I'll get a copy of your book. It's one of the few C# books I don't already have. I guess I just needed an excuse to get it and you just gave me a good one. ;)

(Notice to authors: in exhange for really good and quick replies to my
posts, I'll purchase a copy of your book. How's that for a deal? ;)

However, in this case I think I'll use Eric's suggestion for saving user
preferences. (...I already have Eric's book. It's one of my favorites.)

Regards,
Mountain

P.S. The book I'm most excited about reading next is "Build Your Own ..Net Language and Compiler" by Edward G. Nilges, Josef Finsel


Josef had the idea and I am in his debt. He is a real nice guy who
already has some great books to his credit, and I urge you to look up
his work on Amazon, including The Reluctant Data Base Administrator's
Handbook. It is a book for a programmer who's been told by his manager
that he is now a DBA.

But Josef had to bail out of the actual writing of the book and I am
finishing it up for release early next year. I have written a compiler
for most of Quick Basic and spend the meat of the book in explaining
how that's done, using object oriented techniques, recursive descent,
and BNF.

I use Visual Basic and not C# to appeal to a wide audience.

"Mickey Williams" <my first name at servergeek.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
"Mountain Bikn' Guy" <vc@attbi.com > wrote in message
news:K2rvb.1992 58$mZ5.1480585@ attbi_s54...
> What is the current preferred way to save user preferences in dotnet? Is
the
> registry the right place to do this? Can anyone recommend a good
article (or
> book) for this topic? Thanks.

For a desktop app, save information in per-user registry keys, or in
XML files kept in per-user folders. I have some discussion about this in my book, but frankly the documentation for the methods is fairly
straightforward . See the help on Application.Use rAppDataPath and
Application.Use rAppDataRegistr y. Keep in mind that new folders and

registry
keys will be generated for each version of your app that writes to these locations, so you'll want to start managing your version numbers

before you
start using these properties.

--
Mickey Williams
Author, "Microsoft Visual C# .NET Core Reference", MS Press
www.servergeek.com

Nov 15 '05 #8
Luckly I will download you're book from peer2peer networks and not buy it.
Phew, dont want to waste my money on some VB book.
"Alvin Bruney" <al**********@t elia.com> wrote in message
news:Oz******** ******@TK2MSFTN GP11.phx.gbl...
Yes by using VB you are sure to attract C# coders!! GENIUS!
"Edward G. Nilges" <sp*********@ya hoo.com> wrote in message
news:f5******** *************** ***@posting.goo gle.com...
"Mountain Bikn' Guy" <vc@attbi.com > wrote in message

news:<cYLvb.209 194$ao4.744288@ attbi_s51>...
Thanks. I'll get a copy of your book. It's one of the few C# books I don't already have. I guess I just needed an excuse to get it and you just gave me a good one. ;)

(Notice to authors: in exhange for really good and quick replies to my
posts, I'll purchase a copy of your book. How's that for a deal? ;)

However, in this case I think I'll use Eric's suggestion for saving user preferences. (...I already have Eric's book. It's one of my favorites.)
Regards,
Mountain

P.S. The book I'm most excited about reading next is "Build Your Own .Net Language and Compiler" by Edward G. Nilges, Josef Finsel


Josef had the idea and I am in his debt. He is a real nice guy who
already has some great books to his credit, and I urge you to look up
his work on Amazon, including The Reluctant Data Base Administrator's
Handbook. It is a book for a programmer who's been told by his manager
that he is now a DBA.

But Josef had to bail out of the actual writing of the book and I am
finishing it up for release early next year. I have written a compiler
for most of Quick Basic and spend the meat of the book in explaining
how that's done, using object oriented techniques, recursive descent,
and BNF.

I use Visual Basic and not C# to appeal to a wide audience.

"Mickey Williams" <my first name at servergeek.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
> "Mountain Bikn' Guy" <vc@attbi.com > wrote in message
> news:K2rvb.1992 58$mZ5.1480585@ attbi_s54...
> > What is the current preferred way to save user preferences in dotnet? Is the
> > registry the right place to do this? Can anyone recommend a good article (or
> > book) for this topic? Thanks.
>
> For a desktop app, save information in per-user registry keys, or in XML > files kept in per-user folders. I have some discussion about this in my > book, but frankly the documentation for the methods is fairly
> straightforward . See the help on Application.Use rAppDataPath and
> Application.Use rAppDataRegistr y. Keep in mind that new folders and
registry
> keys will be generated for each version of your app that writes to these > locations, so you'll want to start managing your version numbers before you
> start using these properties.
>
> --
> Mickey Williams
> Author, "Microsoft Visual C# .NET Core Reference", MS Press
> www.servergeek.com
>
>
>
>


Nov 15 '05 #9
"Mountain Bikn' Guy" <vc@attbi.com > wrote in message news:<mHSvb.209 956$275.783419@ attbi_s53>...

I use Visual Basic and not C# to appeal to a wide audience.

rats


Sorry you feel that way. Here's my reasoning.

All or most C# programmers know Visual Basic, but not all Visual Basic
programmers know C#. Ergo I have a wider audience by using Visual
Basic.

C# allows more access to unmanaged facilities and features in general.
But, to show the basics of a compiler's front end, I need to Keep It
Simple and again accessible to programmers who use VB for the most
part.

You know, Brian Kernighan himself uses Visual Basic to teach Computer
Science 101 to non-majors, at Princeton University. He says he's
concerned to show America's best and brightest that programming is not
for dullards. Dave Hansen, also at Princeton, also opined to me that
doing a good job is more difficult using a language such as Cobol, the
VB of its day.

VB doesn't allow you to use pure pointers to point at void material,
invalid material, or the shimmering Moon: but this is a good thing.
There's no reason I can think of why a compiler would need untyped or
void data.

I will certainly concede that with Josef Finsel and with Dan Appleman
I decided in 2002 to use VB for the above reasons, and this was before
the move to C# at many shops in preference to VB.Net. I did not
foresee the popularity of C#, and, I can see its power at my current
"day job" where I use it.

I am in no mood to mount a typical, and profoundly narcissistic,
defense of Visual Basic, because over a career spanning thirty years,
I have heard too many rhodomontades, in defense of a programmer's
favorite language. I remain silent during these rhodomontades because
I abandoned the languages I started out with (1401 SPS and machine
language) as fast as I could...by debugging a nonworking Fortran
compiler in object code form. Since that time, I have programmed in
machine, several assemblers, Fortran,Cobol, Rexx, PL/I, True Basic,
Quick Basic, Visual Basic (3.. .Net), C#, C, C++, several special
purpose languages for the writing of scripts, and Spinoza, my own
language.

I have not found the language of the gods. This would be one in which
you did not need to write comments and in which clean compilation
would almost completely imply correct execution. Eiffel may be what I
am thinking about or object Spinoza.

My favorite language happens to be computer science and algorithms,
the common language of all programming languages.

Had Algol succeeded it might have become my favorite language, because
the designers of Algol were not in thrall to immediate corporate
needs, and because they foresaw (in their ideas about publication
languages) the need to couple the language to its presentation.

But, odds are you know VB, even if you dislike it. I can assure you
that the book will be free of excess respect for third party tools
which is characteristic of the VB community and shall instead stress
good algorithms which are uncharacteristi c of the VB community. It
shall also be written in a witty and amusing fashion, also
uncharacteristi c of the VB community.
Nov 15 '05 #10

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

Similar topics

2
2095
by: godyuyu | last post by:
i need change the system preferred audio device in my vc++ project ,but i can't find the resolution.I just want to know the method.
4
1629
by: Ale K. | last post by:
I got a Structure that handles all the Data for my DB Connections like, type of database, usernames, servers,etc and i was wondering what was the best approach to save that data. What is the better approach of the 2 followings: 1- Use serialization and just reload the object every time the application reloads. 2- Use a class to access INI files , write all the propertys there and then encrypt the file. Thanks.
6
8005
by: Luis | last post by:
Hello All! I know this may be beginner stuff but... I was wondering if there is a way to save text from a text box to an Application Configuration file and maybe hash it so that the text in the file is not the real text needed to login? I am loking to create simple ftp client to perform one function, and that is to dl one file, and rename it. Everything works fine, except I am a bit uncomfortable leaving the password of the ftp location...
3
5034
by: pealy2 | last post by:
Sorry if this is in the wrong group, I've searched long & hard without finding anything even slightly useful. (recommendations for a more relevant group gratefuly received) I need to change the settings for the default web service user account so that sounds go through a sound card rather than the on-board sound. I can do this simply when I'm logged in to my own user account by going through control panel. If I can't log on as the Web...
6
5118
by: Laserson | last post by:
Hi! I have one question about SaveSetting() function. I have one checkbox and i want to save it's state on form closing and then restore it on form loading. How can i make it?
3
1972
by: shapper | last post by:
Hello, In my Page's VB.NET code I am changing the value of the Profile property NAME. Profile.Name = tbName.Text However, I need to change this property value from a class in my App_Code so I did:
0
9957
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10770
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10875
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10432
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9593
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5809
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4632
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4238
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3245
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.