开发者

Shared Storage in .net windows forms application

Is there something like shared storage in .net windows forms applications, What I want to do is to build 开发者_运维技巧a settings form, where each user can save his own settings on his machine, without the need to explicitly create external files and save the values in these files.

Thanks


Maybe Isolated storage suit your needs. Also you can think about registry.


you can use the "Settings" to do this - just choose "User" instead of "Application" - this way the properties will not be stored into the app.config but onto a nested directory in the users home-directory. You can load/save those settings on runtime too (unlike the app.config settings)


Settings have to be stored somewhere, and unfortunately that either means in the Registry (which is heavily abused, and is technically stored in an external file within Windows), in an external file on disk that you create, a remote server (xml over http), or a database. The settings simply have to exist some place they can be loaded again, but the place you choose to write them to is up to you.

I completely understand that you do not want to have to manipulate the file itself by means of reading it, parsing it, then loading. Flip side, getting settings, translating into a config format, and writing to disk. This is an annoying process.

You could use Application Configuration or User Settings, and these are easily visible to the user. If you want something hidden, there really isn't such a thing. A user who really wants to snoop through an applications files, will generally find what they are looking for, and most everything is vulnerable to some degree. You could encrypt your configuration settings, but you still have to work with the file.

My recommendation would be to implement a database like SqlServerCE. Its a file system based database, where the data is not immediately accessible, you can put the file somewhere somewhat hidden (ie. C:\ProgramData\etc\etc), and you don't have to do a whole lot of work. But like I said, what you are asking for requires some work.


If you want to setting file invisible to users, Try to save your settings in Registry, instead of Application Settings in User scope, I think this is a suitable way for your application.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜