Connecting Tech Pros Worldwide Forums | Help | Site Map

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

ian.johns@gmail.com
Guest
 
Posts: n/a
#1: Nov 23 '05
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.


Simon
Guest
 
Posts: n/a
#2: Nov 23 '05

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


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("F ilePath")

"ian.johns@gmail.com" wrote:
[color=blue]
> 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.
>
>[/color]
Closed Thread