开发者

Shared Windows-Application settings file (*.settings)?

开发者 https://www.devze.com 2022-12-12 02:04 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号