alexk Posted January 26, 2003 Posted January 26, 2003 How can write and read data in INI file using VB.NET??? Quote
bungpeng Posted January 28, 2003 Posted January 28, 2003 Is there any different to read/write text file with INI file? Do you know how to read/write text file? Quote
*Gurus* divil Posted January 28, 2003 *Gurus* Posted January 28, 2003 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, you'll probably have to resort to use the API or writing your own routines to parse them. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Leaders quwiltw Posted January 28, 2003 Leaders Posted January 28, 2003 INI files are depreciated. In value? Does this mean they're on their way to being "deprecated"?:D Quote --tim
TechnoTone Posted January 28, 2003 Posted January 28, 2003 Don't you know that it's extremely bad etiquette to correct people's spelling and/or grammar on internet forums? Especially considering the number of people who use them of whom English is not their first language. Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
Leaders quwiltw Posted January 28, 2003 Leaders Posted January 28, 2003 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 wouldn't 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 I'm wrong, my sincere apologies divil:( Quote --tim
TechnoTone Posted January 28, 2003 Posted January 28, 2003 Fair enough. ;) Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
Datahighway Posted January 28, 2003 Posted January 28, 2003 Hi alexk, i have found a sample for you. Try this . http://www.allapi.net/classlib/class.php?id=1 The INIReader class reads data from and writes data to INI files Regards Datahighway Quote
*Gurus* divil Posted January 28, 2003 *Gurus* Posted January 28, 2003 Don't worry about it quwiltw, next time you make a spelling error I'll be watching... :P Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
alexk Posted January 29, 2003 Author Posted January 29, 2003 Thanks to Datahighway about a sample. But... This method use API declaration like in VB6! There are not ready-made object in VB.NET? Quote
Leaders quwiltw Posted January 29, 2003 Leaders Posted January 29, 2003 There are not ready-made object in VB.NET? Yes, as divil said, for the replacement, xml files. There's great built-in support. You've still not answered why you would ever want an ini file instead of the xml file? Quote --tim
*Gurus* divil Posted January 29, 2003 *Gurus* Posted January 29, 2003 INI files haven't been a recommended method of data storage since Windows 3.11. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
*Experts* Nerseus Posted January 29, 2003 *Experts* Posted January 29, 2003 If you must read an INI file from a program that you're not writing, you will have to use the API. If you're writing an application, I wouldn't use an INI - use XML or the registry. I haven't 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 you're looking for something specific from an INI file go ahead and ask - maybe there's a better way to get at it now than through an INI. Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.