tags:

views:

32

answers:

1

I have an wcf service that is hosted in II6. The service uses the server's file system to persist information. Now the persistence directory is hard coded to be F:\PM. How can I use a configuration file to store this directory? How can I access this file with a form application so as to modify it?

+1  A: 

You would place the information in the web.config file

   <appSettings>
    <add key="Directory" value="F:\PM" />
   </appSettings>

To read the value out of the config file

string directoryLocation = ConfigurationSettings.AppSettings["Directory"];

To update the file from a winforms app, you could read and update the file.

Shiraz Bhaiji