Working with a simple INI file in VB.net 2005

I've been trying get a clear idea of reading and writing a simple ini file for a VisualBasic.net 2005 program I am writing.  Even searching here on EE, I can find info regarding VB6.  Has something changed with VB.net?  Everything I've found shows VB6.  I know that newer technology is to use the registry, but I'd like to keep with ini because the end user can screw up less with the ini file.

So where can I find a clear explaination of reading and writing (or editing) an INI file for my program?
tspeicherAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jorge PaulinoIT Pro/DeveloperCommented:
INI files are not used in VB.NET, and you have XML files instead, that is the replacer. You can use application settings to easy store your information.
Still, if you want to work with INI files you can use the API's GetPrivateProfileString and WritePrivateProfileString.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tspeicherAuthor Commented:
Well that's good to know.  That would explain why my searches were so unproductive.  So how can I use the XML files to store settings for my program like INI files used to use?

0
Mike TomlinsonMiddle School Assistant TeacherCommented:
What kind of settings do you need to store?...and does the user really need to change them OUTSIDE of your app? It's easy enough to make a "Setup" form inside your app...
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Jorge PaulinoIT Pro/DeveloperCommented:
0
tspeicherAuthor Commented:
The user doesn't really *need* to change them.  There are about 10 true/false settings that customize the program along with at least one numeric value.

I was just trying to keep the user away from the registry.
0
Éric MoreauSenior .Net ConsultantCommented:
0
Jorge PaulinoIT Pro/DeveloperCommented:
>> The user doesn't really *need* to change them.  There are about 10 true/false settings that customize the program along with at least one numeric value.
Application settings exists for that and you can choose if the user changes it or not, in your code.
Have you tried to use them ?
0
tspeicherAuthor Commented:

>Application settings exists for that and you can choose if the user changes it or not, in >your code.
>Have you tried to use them ?
I just started learning about them with this post.  It brings up an interesting situation as the program is accessing a database and there could be different users accessing from different computers, or different users on one computer.  Then I have to decide if I want the settings to be global or based on individual user settings.
One global solution might be to put the persistent settings in a table in the database.  Then the settings will even get backed up with the database.  
User config files are per user, Right?  
Ini files are per computer, Right?
Database table would be global?
0
Éric MoreauSenior .Net ConsultantCommented:
>>User config files are per user, Right?  

Yes. And a user loose his settings when switching computer.

>>Ini files are per computer, Right?

It depends where you saved them. Do you save them in a folder private to the user or global to the computer?

>>Database table would be global?

This is nice when people go from one computer to another. This way, they never loose any settings.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.