Link to home
Start Free TrialLog in
Avatar of davemabe2000
davemabe2000

asked on

Where to store ini files, log files for an application?

Where should I be storing any ini files and log files that my application creates and uses?  I've been storing them right in the program's directory under Program Files which I realize now is not optimal - but works until users start using Vista.

So, where should I be storing them so that it will work on Vista and other versions of Windows?  Should the program create a folder in this place or should I have the install program do it?
ASKER CERTIFIED SOLUTION
Avatar of b0lsc0tt
b0lsc0tt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Pretzel_Jesus
Pretzel_Jesus

Actually you never put in a path to the files it uses whatever folder they are currently in, vista or otherwise. So things like:

StreamReader sr = new StreamReader("settings.ini");

would read data right from the root folder, regardless of where it is. This works for any OS.
I'm glad I could help.  I am curious about the B grade though.  Since you never posted a response it would seem my comment was all you needed for an answer.  If that is the case this is complete and should get an A grade.  Please let me know how this turned out and why the grade.  If a mistake was made or you have a question about what grades mean here then let me know.
Thanks for the fun question.
bol