
September 7th, 2007, 03:11 PM
|
 |
Evil Republican...
|
|
Join Date: Jun 2005
Location: Probably running over your cat right now...
|
|
|
How do I use configuration files?
I'm very novice at VB, and I'm using visual basic 2005 express edition right now. I have a copy of Visual Studio 2005 Standard on the way to finish my particular project, but I need some help with one area in particular:
I have several environment variables I would really like to be able to dynamically set based upon the user running my program.
One set of them involve the SQL Server, database name and authentication credentials to connect to a particular database.
Another set of them involve file paths... one for source files and the other for destination files.
I was thinking that a "config.ini" type of file would be a great way to accomplish this... my users are in a citrix environment and putting the file in the application directory is not a suitable option, but putting it in their /%Profile%/Windows directory would work nicely.
How do I tell my VB application to read a "config.ini" file? How do I incorporate the creation and distribution of this file into my application? And how do I pass variables from this file into my application?
I have read the help on configuration files and it has all seemed very cryptic to me at this point... can anyone refer me to a more straightforward explanation of a how-to incorporate an ini file into a program?
__________________
IF ADVICE = 'GOOD'
INSERT INTO scales (REPUTATION_POINTS, REASON)
VALUES (+1, 'BECAUSE ITS GOOD TO DO THAT')
END
|