Home All Groups Group Topic Archive Search About
Author
30 Jun 2005 10:27 AM
Daniel
Hi Group,

I need to store some app settings.  I always used an INI file in VB6
using WritePrivateProfileString but I have read that XML is now the way
to do it with .NET

Any suggestions as which to use?  I don't need to store anything
complicated so I just want the simplest solution!

--

Daniel
MCSE, MCP+I, MCP in Windows 2000/NT

--------------------------------------
remove the 2nd madrid from my mail address to contact me.

Author
30 Jun 2005 10:42 AM
Cor Ligthert
Daniel,

That depends, if it are really application settings (and not user settings),
than probably the registry is more the way, which is extremely simple to
handle in VBNet.

I hope this helps,

Cor
Author
30 Jun 2005 10:43 AM
Ken Tucker [MVP]
Hi,

        I prefer to use xml because you can databind the controls settings
to the xml file.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadvnet/html/vbnet02122002.asp

Ken
-------------------
"Daniel" <dan***@madridmadridsoleado.com> wrote in message
news:ubSHS5VfFHA.1048@tk2msftngp13.phx.gbl...
Hi Group,

I need to store some app settings.  I always used an INI file in VB6
using WritePrivateProfileString but I have read that XML is now the way
to do it with .NET

Any suggestions as which to use?  I don't need to store anything
complicated so I just want the simplest solution!

--

Daniel
MCSE, MCP+I, MCP in Windows 2000/NT

--------------------------------------
remove the 2nd madrid from my mail address to contact me.
Author
30 Jun 2005 11:13 AM
Daniel
Daniel wrote:
> Hi Group,
>
> I need to store some app settings.  I always used an INI file in VB6
> using WritePrivateProfileString but I have read that XML is now the way
> to do it with .NET
>
> Any suggestions as which to use?  I don't need to store anything
> complicated so I just want the simplest solution!
>

Thanks.  Although I am tempted to use an INI file I think I'll stick the
settings in the registry.

--

Daniel
MCSE, MCP+I, MCP in Windows 2000/NT

--------------------------------------
remove the 2nd madrid from my mail address to contact me.
Author
30 Jun 2005 12:15 PM
Herfried K. Wagner [MVP]
"Daniel" <dan***@madridmadridsoleado.com> schrieb:
> I need to store some app settings.  I always used an INI file in VB6 using
> WritePrivateProfileString but I have read that XML is now the way to do it
> with .NET
>
> Any suggestions as which to use?  I don't need to store anything
> complicated so I just want the simplest solution!

Many people prefer XML files over standard INI files because of the "XML
hype".  However, XML files suffer from the problem that XML was not designed
to be a human-readable data format.  INI files are more readable and even an
"untrained" user will be able to edit them.  Alternatively you can write the
data to the registry using 'SaveSetting'/'GetSetting' or the
'Microsoft.Win32.Registry' class.  In addition to that you may want to store
the INI or XML file in an isolated storage.

Storing and loading user preferences
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=userpreferences&lang=en>

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
30 Jun 2005 1:08 PM
Carlos J. Quintero [.NET MVP]
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> escribió en el mensaje
news:Om%23Dh1WfFHA.3916@tk2msftngp13.phx.gbl...
> Many people prefer XML files over standard INI files because of the "XML
> hype".

Apart from the hype, XML supports hierarchies of settings much better than
flat ini files...

> However, XML files suffer from the problem that XML was not designed to be
> a human-readable data format.  INI files are more readable and even an
> "untrained" user will be able to edit them.

XML is also human-readable, but much less readable than an .ini file,
certainly...

In any case IMO configuration files should not be edited by hand, only using
the app options window, not to mention edited by hand by untrained users...

Also, using a file instead of the registry makes the app more portable
between locations/computers, for the day when we will be able to install
apps again just XCOPYing them...old MS-DOS times ....

Just my 2 eurocents...

--
Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
Author
30 Jun 2005 3:22 PM
Daniel
Herfried K. Wagner [MVP] wrote:
Show quoteHide quote
> "Daniel" <dan***@madridmadridsoleado.com> schrieb:
>
>> I need to store some app settings.  I always used an INI file in VB6
>> using WritePrivateProfileString but I have read that XML is now the
>> way to do it with .NET
>>
>> Any suggestions as which to use?  I don't need to store anything
>> complicated so I just want the simplest solution!
>
>
> Many people prefer XML files over standard INI files because of the "XML
> hype".  However, XML files suffer from the problem that XML was not
> designed to be a human-readable data format.  INI files are more
> readable and even an "untrained" user will be able to edit them. 
> Alternatively you can write the data to the registry using
> 'SaveSetting'/'GetSetting' or the 'Microsoft.Win32.Registry' class.  In
> addition to that you may want to store the INI or XML file in an
> isolated storage.
>
> Storing and loading user preferences
> <URL:http://dotnet.mvps.org/dotnet/faqs/?id=userpreferences&lang=en>
>
precisely my point of view.  The old "if it ain't broke..."  This time
i'll use the registry but i am glad that INI files are not lost yet!
Besides, (dare i say it) I suspect that access to an INI file would be
quicker than the registry based purely on the size of the registry vs
the size of the INI file.

Thanks.

--

Daniel
MCSE, MCP+I, MCP in Windows 2000/NT

--------------------------------------
remove the 2nd madrid from my mail address to contact me.
Author
30 Jun 2005 11:13 PM
Dennis
One method I like is to use a seralizable Class containing all the properties
as fields then serialize it to a file when the app is closed or whenever you
want to change something then unserialize it when the app is opened.

Personally, I don't like programmers messing with my registry, only
Microsoft.  I know that many apps do but I still don't like it an when I port
a program to another computer, I can easily take my settings with me.
--
Dennis in Houston


Show quoteHide quote
"Daniel" wrote:

> Herfried K. Wagner [MVP] wrote:
> > "Daniel" <dan***@madridmadridsoleado.com> schrieb:
> >
> >> I need to store some app settings.  I always used an INI file in VB6
> >> using WritePrivateProfileString but I have read that XML is now the
> >> way to do it with .NET
> >>
> >> Any suggestions as which to use?  I don't need to store anything
> >> complicated so I just want the simplest solution!
> >
> >
> > Many people prefer XML files over standard INI files because of the "XML
> > hype".  However, XML files suffer from the problem that XML was not
> > designed to be a human-readable data format.  INI files are more
> > readable and even an "untrained" user will be able to edit them. 
> > Alternatively you can write the data to the registry using
> > 'SaveSetting'/'GetSetting' or the 'Microsoft.Win32.Registry' class.  In
> > addition to that you may want to store the INI or XML file in an
> > isolated storage.
> >
> > Storing and loading user preferences
> > <URL:http://dotnet.mvps.org/dotnet/faqs/?id=userpreferences&lang=en>
> >
> precisely my point of view.  The old "if it ain't broke..."  This time
> i'll use the registry but i am glad that INI files are not lost yet!
> Besides, (dare i say it) I suspect that access to an INI file would be
> quicker than the registry based purely on the size of the registry vs
> the size of the INI file.
>
> Thanks.
>
> --
>
> Daniel
> MCSE, MCP+I, MCP in Windows 2000/NT
>
> --------------------------------------
> remove the 2nd madrid from my mail address to contact me.
>
Author
1 Jul 2005 11:38 AM
Chad Z. Hower aka Kudzu
Daniel <dan***@madridmadridsoleado.com> wrote in news:ubSHS5VfFHA.1048
@tk2msftngp13.phx.gbl:
> Any suggestions as which to use?  I don't need to store anything
> complicated so I just want the simplest solution!

http://www.codeproject.com/dotnet/XMLSettingsFile.asp


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
      "Programming is an art form that fights back"

Empower ASP.NET with IntraWeb
  http://www.atozed.com/IntraWeb/
Author
18 Jul 2005 10:33 AM
Daniel
Chad Z. Hower aka Kudzu wrote:
Show quoteHide quote
> Daniel <dan***@madridmadridsoleado.com> wrote in news:ubSHS5VfFHA.1048
> @tk2msftngp13.phx.gbl:
>
>>Any suggestions as which to use?  I don't need to store anything
>>complicated so I just want the simplest solution!
>
>
> http://www.codeproject.com/dotnet/XMLSettingsFile.asp
>
>
> --
> Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
>       "Programming is an art form that fights back"
>
> Empower ASP.NET with IntraWeb
>   http://www.atozed.com/IntraWeb/

:-O

My jaw drops in astonishment.  This is soooooo easy!  Thanks.

--

Daniel
MCSE, MCP+I, MCP in Windows 2000/NT

--------------------------------------
remove the 2nd madrid from my mail address to contact me.