Shared Windows-Application settings file (*.settings)?
I develop a desktop application that will be installed in few stations in the local network, I want the *.settings to fetch the settings from the DB when the program loads, the save it on SaveChanges.
I don't care in which way to do it (I thought SQL would work best as this is the only common thing between the users, if you don't have better ideas), my point is to have settings file that is common to all the stations.
I need technicial details, pl开发者_Go百科ease refer me to some good links or stuff.
Thanks
I would do this if I were you:
Create an App.config, create a section that points to the location of your db. For example:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="dbstring" value="\\bignetwork\db\abc.mdb"/>
<add key="shareresourcedir" value=value="\\bignetwork\db\resource"/>
</appSettings>
</configuration>
Compile my application and distribute it. All the relevant setting will be stored inside yourapp.exe.config
. Make sure that the dbstring
section ( and all the related ones) are never ever changed across all the computers.
This is it.
I think I will handle the retrival and saving of the settings to the DB thru the ApplicationSettingsBase
's events.
精彩评论