ini replacement to xml format
Category:
C#, VB.NET, ASP.NETType:
ClassesDifficulty:
IntermediateAuthor:
Tamas BaloghVersion Compatibility: Visual Basic.NET
More information:
"Microsoft has been trying to get developers to move away from INI files for quite some time, pithily suggesting using the Registry instead... despite the fact that it's rarely a suitable replacement. Well, this "hint" persists with .NET, which proudly boasts absolutely no intrinsic support for INI files."
says Karl Moore on dotdotnet.com (www.developer.com/net/asp/article.php/3287991).
He also gives a module that converts the old VB6 style API calls for Ini to .NET
A similar module for Xml can be found on the same side (www.gotdotnet.com/userfiles/demeester/XMLINIFile.zip).
What I did is to bring the two module under a common hook where the two ways of storing config data is compatible with each other.
Also I wanted to use to new opportunities of the Xml e.g: multi keys, attributes. I made it available also.
Plus I added a custom Collection and enumerator to the Config Data read from the ini, or xml file to be able to store and move the settings.
Parts:
IniConfigFile: working with ini file
XmlConfigFile: working with xml file
ConfigItem: represents a configuration item
ConfigList: special collection for the configuration items (section, key, id, value)
IConfigListEnumerator: special enumerator to support for...each structure for ConfigList
IConfigFile: interface for the ini compatible mode
XmlConvert: convert acceptable ini section and key names into an xml acceptable name, and transform an ini file into an xml format
For detailed info: see the attached file and the readme file in it
Instructions: Click the link below to download the code. Select 'Save' from the IE popup dialog. Once downloaded, open the .zip file from your local drive using WinZip or a comparable program to view the contents.
Download xmlreplacementforinifiles.zip