alternative to .ini file to store file locations in Windows Service

I

ian.johns

I just need a simple code snippet to read from a config file the file
locations needed for my Windows Service. Sort of like web.config but
since this is a Windows Service, I won't be using that.
 
G

Guest

You can create and a App.Config file in a Windows Service project but as I
have not actually tried wirking with it, I cannot be sure that it actually
works.

The App.Config file is structured like:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="FilePath" value="C:\Path\" />
</appSettings>
</configuration>

And is accessed as follows:
Configuration.ConfigurationSettings.AppSettings("FilePath")
 

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