3关于用户设置和用户数据以及适当存储的问题. [英] 3 Questions about User Settings and User Data and the appropriate storage.

查看:57
本文介绍了3关于用户设置和用户数据以及适当存储的问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个执行以下操作的应用程序:

-通话数据-记录电话,快速拨号和未接来电. ListBox是数据绑定到这些文件的文件.
-用户设置-当前正在使用My.Settings.
-调试文件-记录一些SIP协议跟踪.

我需要解决的问题:

-通话数据
--------------------------
我正在使用IsolatedStorage,因此不存在与安全性相关的问题,尤其是因为应用程序与此文件紧密耦合.我不希望普通用户容易找到它,但是管理员可以根据需要查找和更改.我认为IsolatedStorage可以满足我的需求.

问题:如果升级了应用程序,我需要数据可用吗? IsolatedStorage可以做到这一点吗,以及将v.1和v.2保持在同一范围内需要什么IsolatedStorageScope?

-用户设置
- -------------------------

问题:当前使用My.Settings的解决方案有效,但是我想知道是否升级将文件保存到v.2,因为文件保存的路径是1.0.0.0 \ user.config?我不想编码升级安装程序包来读取xml文件.我想要像My.System一样简单的东西,但不确定我有哪些选项.

-调试文件
----------------- ---------

问题:IsolatedStorage可以工作,因为我不在乎它的保存位置,并且文件可以通过UI而不是Explorer访问.此数据不需要通过版本进行维护.

使用VS 2008 SP1

TIA,

Steve


I have an application that does the following:

- Call Data - logs phone calls, speed dial and missed incoming calls. ListBox is databound to these files.
- User Settings - currently using My.Settings.
- Debug File - logs some SIP protocol traces.

Issues that I need to address:

- Call Data
--------------------------
I was looking at using IsolatedStorage so there is no security related issues especially since the application is so tightly coupled with this file. I do not want it easy to find by an average user, but an admin could find and change if required. I think IsolatedStorage meets my needs here.

QUESTION: I need the data to be available if the application is upgraded? Can IsolatedStorage do this and what IsolatedStorageScope is required to keep v.1 and v.2 in the same scope? The signed exe and dll file names will remain the same, but not sure if this is all that is required to make available from v.1 to v.2?

- User Settings
--------------------------

QUESTION: The current solution using My.Settings works, but am wondering if I upgrade the app to v.2 since the path the file is saved to is 1.0.0.0\user.config? I dont want to have to code the upgrade setup package to go an read the xml file. I want something easy as the My.System, but not sure what options I have.

- Debug File
--------------------------

QUESTION: IsolatedStorage will work because I do not care where it is save and the file is access from the UI and NOT Explorer. This data doesnt need to be maintained through versions.

Using VS 2008 SP1

TIA,

Steve


推荐答案

史蒂夫,

如果您的程序集没有强名称签名,则在版本变更.但是,如果您的程序集是强名称签名的,则只有具有相同主版本号的相同程序集将共享隔离存储.这意味着您的v1.0和v1.9将获得相同的存储空间,而v2.0将获得另一个存储空间.之所以这样设计,是因为通常主要版本更改意味着基础数据存储区也具有重大更改.在这种情况下,您可能需要使用设置迁移功能来导入/导出设置.

如果要完全跳过版本控制故事,则只需编写自己的设置存储代码,即可将设置存储在%appdata%\<您的公司名称> \<您的产品名称>文件夹之类的东西.

毕竟,隔离存储应该在应用程序之间隔离数据,这似乎不是从用户隐藏存储信息的好方法.即使是普通用户,也可以使用Windows搜索功能通过使用数据中显示的一些关键字来查找文件.如果您真的想保护自己的数据,请对其进行加密.

此外,尽管您可能使用WPF作为应用程序的表示层,但这个问题实际上与WPF无关,我相信您可以得到更多建议和建议. .NET基本类库论坛.

关于,
Jie
Hi Steve,

If your assembly is not strong name signed, then it will get the same isolated storage after a version change. However, if you assembly is strong name signed, then only the same assembly with the same major version number will be sharing the isolated storage. That means your v1.0 and v1.9 will get the same storage, but v2.0 will get another one. It is designed like this because usually a major version change means the underlying data store also has significant changes. You may need to make a setting migration feature to import/export settings in this scenario.

If you want to totally skip the versioning story, you can just write your own setting storage code, to store settings in the %appdata%\<Your Company Name>\<Your Product Name> folder, or something like that.

After all, the Isolated Storage is supposed to isloate the data from applications to applications, doesn't seem like a good way to hide stored information from the users. Even an avarage user can use the Windows search feature to find out the file by using some keywords that appears in the data. If you really want to protect your data, encrypt it.

Besides, although you might be using WPF as your application's presentation layer, this question is really not WPF related and I believe you can get more suggestions and helps from the community at the .NET Base Class Library forum.

Regards,
Jie


这篇关于3关于用户设置和用户数据以及适当存储的问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆