Read from and Write to INI file.

INI files are depreciated. Use XML files instead, the framework provides plenty of methods for reading and writing those.

If you really must use INI files, youll probably have to resort to use the API or writing your own routines to parse them.
 
Dont you know that its extremely bad etiquette to correct peoples spelling and/or grammar on internet forums? Especially considering the number of people who use them of whom English is not their first language.
 
If I thought for a second that the recipient might be even slightly offended I would never, but in this case I was confident that I wouldnt send divil into a downward spiral of self-deprecating depression by goofind around a bit. Methinks divil will recover from my quip in no time. If Im wrong, my sincere apologies divil:(
 
Dont worry about it quwiltw, next time you make a spelling error Ill be watching... :P
 
Thanks to Datahighway about a sample.
But... This method use API declaration like in VB6!
There are not ready-made object in VB.NET?
 
Originally posted by alexk
There are not ready-made object in VB.NET?
Yes, as divil said, for the replacement, xml files. Theres great built-in support. Youve still not answered why you would ever want an ini file instead of the xml file?
 
INI files havent been a recommended method of data storage since Windows 3.11.
 
If you must read an INI file from a program that youre not writing, you will have to use the API. If youre writing an application, I wouldnt use an INI - use XML or the registry.

I havent seen any support for reading/writing INIs in the .NET framework whereas the API was made just for that purpose. It takes care of all the file parsing and is the recommended way to read/write an INI file.

-Nerseus

edit:
P.S. It might be worth mentioning that most of the old windows INI files exist for backwards compatability. For instance, ODBCINST.INI, which contains ODBC drivers, is now in the registry. Pretty much everything you would want from win.ini or system.ini is in the registry. If youre looking for something specific from an INI file go ahead and ask - maybe theres a better way to get at it now than through an INI.
 
Back
Top