|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
INI or XMLHi 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. 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 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 I need to store some app settings. I always used an INI file in VB6news:ubSHS5VfFHA.1048@tk2msftngp13.phx.gbl... Hi Group, 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. Daniel wrote:
> Hi Group, Thanks. Although I am tempted to use an INI file I think I'll stick the > > 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! > settings in the registry. -- Daniel MCSE, MCP+I, MCP in Windows 2000/NT -------------------------------------- remove the 2nd madrid from my mail address to contact me. "Daniel" <dan***@madridmadridsoleado.com> schrieb: Many people prefer XML files over standard INI files because of the "XML > 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! 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/> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> escribió en el mensaje Apart from the hype, XML supports hierarchies of settings much better than news:Om%23Dh1WfFHA.3916@tk2msftngp13.phx.gbl... > Many people prefer XML files over standard INI files because of the "XML > hype". flat ini files... > However, XML files suffer from the problem that XML was not designed to be XML is also human-readable, but much less readable than an .ini file, > a human-readable data format. INI files are more readable and even an > "untrained" user will be able to edit them. 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 Herfried K. Wagner [MVP] wrote:
Show quoteHide quote > "Daniel" <dan***@madridmadridsoleado.com> schrieb: precisely my point of view. The old "if it ain't broke..." This time > >> 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> > 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. 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. -- Show quoteHide quoteDennis in Houston "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. > 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 http://www.codeproject.com/dotnet/XMLSettingsFile.asp> complicated so I just want the simplest solution! -- 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/ Chad Z. Hower aka Kudzu wrote:
Show quoteHide quote > Daniel <dan***@madridmadridsoleado.com> wrote in news:ubSHS5VfFHA.1048 My jaw drops in astonishment. This is soooooo easy! Thanks.> @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 -- Daniel MCSE, MCP+I, MCP in Windows 2000/NT -------------------------------------- remove the 2nd madrid from my mail address to contact me.
Check if Stored Procedure already exists in Access Database?
"Selecting" from a data table Strangest damn error - database at fault? WebBrowser control error Adding desktop shortcuts and start program entries ApplicationDomains Calculating Time in VB .Net How to use OCX? Directinput Dir Function just stopped working! |
|||||||||||||||||||||||