XML/INI Article at Atomic Monks Brother Erryn (11 replies, 29 views) (2004-Jul-7) I've put up a new article on XML files for application settings in VB.NET as an alternative to the INI files commonly used in VB6. The article offers a complete class wrapped up with GetSetting and SaveSetting methods, using the xmlDocument object.
Back to News
| | | An interesting way of getting around the problem, but I wonder how it compares speed-wise to an ini file.
Long program load times are a personal pet peeve for me :) .
| | | well I guess that unless you have like a milion settings you want to save/load then it shouldn't be such a problem.. it's only a little text file after all..
| | | As Rene said...it's a non-issue unless you've got a LOT of data in your INI files.
Since it loads the data in memory just once, it should be pretty snappy. I haven't tested performance, but calls for that data won't be made from within a render loop in anything I make with it. I would think the performance would be better just because it's going the managed code way, instead of via COM.
| | | If your using .NET then you can also use .ADO Which allows you to open xml files as disconnected databases allowing the use of SQL to fool around with the data. Flippin Marvelous.
| | | I looked at ADO.NET for this too, but decided it was SERIOUSLY overkill for what I needed. Definitely a plus about the .NET platform...all the data methods are available, and you don't have to worry about which version of MDAC they have installed, etc.
| | | Yeah, it's probably a non-issue. I was mostly thinking of things like Word, Word Perfect, Opera, Paint Programs, etc.
| | | XML is great for hierarchal information, but INI files are orangized as a Dictionary. [Section]Key=Value. I'm a bit uncertain why you would want to convert a Dictionary to an XML heirarchy. I do see the power of XML for other applications, but as an INI file replacement, it seems like it's a bit overkill.
| | | It probably IS a bit of overkill. Like the article said, though, it seemed the "true" .NET way to do an INI file. On the other hand, it does keep your .NET app out of COM...that's at least one performance bump avoided. :)
| | | But you don't use COM to use INI files... You use the Win API. ...or am I wrong?
| | | Does .NET have dictionary or collection objects? OO is nice, but for data storage and retrieval, hashing and sorting is really the best way for data storage and retrieval.
| | | My understanding is that when you use the API calls in .NET, you do so through COM.
There IS a dictionary object that you can get to in a roundabout way. It looked VERY cludgy to use for an INI file, and was certainly a lot more work.
| | | | | | | | | | |
|