Windows path and settings file

G

Guest

I need to read settings for another application for a very small application.
The settings are stored in a text file, and this file is stored in the
Windows directory.

How can I retrieve the path for the Windows Directory on the local machine?
How do I best read the settings in this file? The settings are in the format
[Data]
datapath=x:\xxx
[Reports]
ReportPath=x:\xxx

I can of course read it as any text file and check every line for what I
need, but there must be a better way of doing it. The settings file contains
about 200 settings, but I only need three of them for my application.
 
M

Morten Wennevik

G

Guest

Thanks Morten,

The links you sent me were right on target. As for the path,
Environment.GetEnvironmentVariable("WINDIR") seems to be what I was looking
for.

Kenneth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top