By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,931 Members | 1,429 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,931 IT Pros & Developers. It's quick & easy.

What's the VB.NET replacement for PropertyBag? Saving preferences.

P: n/a
I need to persist user selections. I know that I can use the Registry, but
I was hoping that there was some sort of "text based" solution.

TIA,

Larry Woods
Nov 20 '05 #1
Share this Question
Share on Google+
16 Replies


P: n/a
Thanks, Herfried,

In all due respect, I would appreciate it if you knew of an English language
site for the example. My German is next to non-existent.

Apologies...

Larry Woods

"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
Hello,

"Larry Woods" <la***@lwoods.com> schrieb:
I need to persist user selections. I know that I can use the Registry,

but
I was hoping that there was some sort of "text based" solution.


XML files:

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

HTH,
Herfried K. Wagner
--
MVP VB Classic, VB .NET
http://www.mvps.org/dotnet

Nov 20 '05 #2

P: n/a
Cor
C# ?
Nov 20 '05 #3

P: n/a
Cor
:-)))
Nov 20 '05 #4

P: n/a
I tend to aggree with you, Cor. The app.config file might be a little more
interesting if there were a complete set of methods for it. As it is, you
can read it, but in order to add/modify it you need to revert to generic XML
methods as far as I can see.

Oh, well... At least I'm not stuck with the old "VBand VBA Program
Settings."

Thanks.

Larry

"Cor" <no*@non.com> wrote in message
news:3f***********************@reader20.wxs.nl...
Larry,
I prefer the registry, it is quiet easy to reach now in VB.Net.

Dim Reg As RegistryKey
Reg = Registry.CurrentUser.CreateSubKey("Software\Woody\ Woody")
Reg.SetValue("Width", pW)

Dim Reg As RegistryKey = Registry.CurrentUser
Reg = Registry.CurrentUser.CreateSubKey("Software\Woody\ Woody")
pW = Reg.GetValue("Width")

When it are more of less fixed variables I have seen you can use the config files. Microsoft calls it "dynamic properties",
but for that me looks as the old INI files.
And of course the XML files, but for me that is more to do something with
lets say more variable changing program things, like a tax rate when you
don't want to redistribute the programs every time, but just deliver a xml
file with that kind of constants.
Cor

Nov 20 '05 #5

P: n/a
Hello,

"Cor" <no*@non.com> schrieb:
C# ?


Yes. I feel sorry, but I do not have a pointer to a good VB .NET sample
(maybe I should write one).

Regards,
Herfried K. Wagner
--
MVP VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 20 '05 #6

P: n/a
Hello,

"Larry Woods" <la***@lwoods.com> schrieb:
In all due respect, I would appreciate it if you knew of
an English language site for the example. My German is
next to non-existent.


;-)

The sample is written in C#, but I think it gives you a good idea on how to
manage settings using an XML file. Just ignore the text, have a look at the
code.

Regards,
Herfried K. Wagner
--
MVP VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 20 '05 #7

P: n/a
Hello,

"Cor" <no*@non.com> schrieb:
I prefer the registry, it is quiet easy to reach now in VB.Net. [...]

I hate programs that save settings to the registry.
And of course the XML files, but for me that is more to do something with
lets say more variable changing program things, like a tax rate when you
don't want to redistribute the programs every time, but just deliver a xml
file with that kind of constants.


XML files have some advantages: They can be easily backed-up, they can be
easily distributed and they can be saved easily for multiple users (for
example in their SpecialFolder.LocalApplicationData folder).

Regards,
Herfried K. Wagner
--
MVP VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 20 '05 #8

P: n/a
Hello,

Larry Woods" <la***@lwoods.com> schrieb:
The app.config file might be a little more interesting if
there were a complete set of methods for it.


"app.config" is not the right place to store user settings ("preferences").

HTH,
Herfried K. Wagner
--
MVP VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 20 '05 #9

P: n/a
Cor
Herfried,
Dinner is ready and my wife said it was delicious. So when Nick says, Cor I
did understand it quiet wrong my day will be well again.
So first make an answer to you and then find out if Charles comes in my
galary of honour "Bill Gates, Herfried, Jay B, ............"
Of course it is misplaced to use the registry, but did you see what
Microsoft does with it with their programs.
And not only them. My registry is grown and grown and I always think, I need
to make a program that is better than from Juri (I think you know whom I
mean, some silly feeling from me has something with youngsters like you and
him). And than I don't do it because my main feeling is to honour him.When
there was a real good behaviour with the registry, I would have the same
idea as you now I thing Foo you.
Cor
Nov 20 '05 #10

P: n/a
Cor
And that is not You. :-)
Nov 20 '05 #11

P: n/a
Hello,

"Cor" <no*@non.com> schrieb:
Dinner is ready and my wife said it was delicious.
:-)
So when Nick says, Cor I did understand it quiet wrong
my day will be well again.
So first make an answer to you and then find out if
Charles comes in my galary of honour "Bill Gates, Herfried,
Jay B, ............"
Zzz.
Of course it is misplaced to use the registry, but did you see what
Microsoft does with it with their programs.
And not only them. My registry is grown and grown and I
always think, I need to make a program that is better than
from Juri (I think you know whom I mean, some silly feeling from
me has something with youngsters like you and him).
Who is Juri?!
And than I don't do it because my main feeling is to honour him.
When there was a real good behaviour with the registry, I would
have the same idea as you now I thing Foo you.


?!?

Regards,
Herfried K. Wagner
--
MVP VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 20 '05 #12

P: n/a
Cor
Herfried,
Before things go wrong.
Juri
Someone from finland here is his Url (the old one www.jv16.org) He did make
when he was 16 a registry cleaner, from which I thougth everybody was using
that. Now he tries to go commercial.
Foo you, When I think it is not nice to do that in the registry, because it
is already such mass made by others, than I put my middle finger in the air
and say ............ and that has nothing to do with you.
Cor
Nov 20 '05 #13

P: n/a
Cor
Herfried,
And I forgot my contribution on functions and methodes is only
understandable for people who speak french or maybe those who understand
latin or Italian, that I don't know. Maybe I did made it to cryptical.
Cor
Nov 20 '05 #14

P: n/a
I wish I could speak Cor fluently. I'm still learning it. :-)

Fergus
Nov 20 '05 #15

P: n/a
Cor
I did post in in the thread. It was my idea about a function and a method in
VB and about mixing up things from one language into the other.
I am always curious if I did write something stupid or my idea was
acceptable for others, but there was no response.
It is posted, because it is on news.Microsoft.com and my regular newsserver.

Nov 20 '05 #16

P: n/a
Hello,

"Cor" <no*@non.com> schrieb:
I did post in in the thread. It was my idea about a function and a
method in VB and about mixing up things from one language into
the other. I am always curious if I did write something stupid or
my idea was acceptable for others, but there was no response.


OK, I'll have a look at your message.

Regards,
Herfried K. Wagner
--
MVP VB Classic, VB .NET
http://www.mvps.org/dotnet
Nov 20 '05 #17

This discussion thread is closed

Replies have been disabled for this discussion.