【发布时间】:2012-03-13 19:24:48
【问题描述】:
我在我的 C# .net 应用程序中使用了独立存储技术。
我的应用程序在关闭时将数据保存在独立存储中名为 MyData.dat 的文件中。
当我打开我的应用程序时,它会重新加载该数据并将其打印在屏幕上。
当我将我的应用程序移动到另一个目录时,例如从 D:\MyApp.exe 到 D:\Apps\MyApp.exe,然后从它的新目录运行应用程序,它无法加载文件 MyData.dat ( FileNotFoundException),因为它在不同的地方寻找不同的 MyData.dat 文件..
有人知道如何将我的隔离文件 - MyData.dat 文件保存在一个无论我从哪里打开 App.exe 都会找到它的地方吗?
【问题讨论】:
-
获取商店的代码是什么样的(例如 GetStore)?
-
我尝试了 IsolatedStorageFile.GetUserStoreForAssembly()。它没有用,所以我尝试了:IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly | IsolatedStorageScope.Roaming, null, null) 这也不起作用..
标签: c# .net isolatedstorage isolatedstoragefile