Parameter/Variable file

Jan-Erik

New member
Joined
Dec 30, 2003
Messages
2
Location
Norway
Hello,

I have a small console application which browses through some folders under ONE spesific folder. This folder is coded in the application (as a variable). I would like to use some kind of file (ini?) to set the path of this folder, and the application will use the folder specified in the file.

Anyone know how Im able to do this?
 
If the only thing your file would contain is the folder path you can easily do it using IO.StreamReader class. If your file will contain more info then you will need to do some searching for the path.
Code:
create a new stream reader so you can read the file
Dim reader As New IO.StreamReader("path to the file")
store path somewhere, this is assuming you have one thing in a file like I said before
read it using the ReadLine method which will get the whole line for you
dim folderpath as string = reader.ReadLine()
reader.Close()
:)
 
I made a class which returns the values of a file, and it works fine. But are there any other ways to make configuration files?

Anyway, thanks for you help. The application works as it should now.
 
Back
Top