【发布时间】:2016-04-03 15:09:59
【问题描述】:
我有一行代码创建了一个IsolatedStorageFile 对象。
IsolatedStorageFile isoFile = IsolatedStorageFile.GetStore(
IsolatedStorageScope.Roaming
| IsolatedStorageScope.User
| IsolatedStorageScope.Assembly,
null, null);
它工作得很好,可以按照我的意愿在执行之间保留数据,但是当我将 exe 移动到不同的文件夹时,它不会收到相同的存储位置。我可以将exe 移回原来的文件夹,所有数据都可以重新使用了。
如何初始化IsolatedStoreFile,以便无论exe 位于哪个文件夹,它始终获得相同的存储位置?
更新:在documentation 这个.GetStore 中声明
null 让 IsolatedStorage 对象选择证据。
很明显,null 正在使用exe 的 URL 作为证据。
我怎样才能强制它使用其他东西?
这是我曾经了解过的文章:DeveloperFusion
【问题讨论】:
-
你看过这篇文章吗? stackoverflow.com/questions/1112681/…
-
@Steve 我没有,但我怎么用呢?
标签: c# .net directory exe isolatedstorage