gpt4 book ai didi

c# - 第一次访问缓存时出现 IsolatedStorage 异常

转载 作者:太空宇宙 更新时间:2023-11-03 16:40:45 24 4
gpt4 key购买 nike

我遇到一个问题,每次我第一次运行应用程序时都会收到 IsolatedStorageException(“IsolatedFileStorageStream 上不允许的操作”)。随后运行该应用程序时,它工作得很好。我已经尝试了所有我能找到的打开文件进行写入的方法,包括

using (var iso = IsolatedStorageFile.GetUserStoreForApplication())
using (IsolatedStorageFileStream file = new IsolatedStorageFileStream(fileName, FileMode.Create, FileAccess.Write, iso))
{
}

using(var iso = IsolatedStorageFile.GetUserStoreForApplication())
using(IsolatedStorageFileStream file = iso.OpenFile(fileName, FileMode.OpenOrCreate))
{
}

以及这些方法的其他各种重载。我所做的一切都没有奏效,我已经按照 Stack Overflow 中所有其他帖子和我能找到的每篇博文中的步骤进行操作。当我查看输出时,每次都会抛出以下异常:

A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.Net.WebException' occurred in System.Windows.dll
A first chance exception of type 'System.Net.WebException' occurred in System.Windows.dll
A first chance exception of type 'System.IO.DirectoryNotFoundException' occurred in mscorlib.dll
A first chance exception of type 'System.IO.IsolatedStorage.IsolatedStorageException' occurred in mscorlib.dll

有没有人对它爆炸的原因有任何其他想法?我正在使用 WP7 7.1 RTM 工具。

最佳答案

这是我学会了如何在 WP7 上写入隔离存储,

Using Isolated Storage on Windows Phone 7

希望对您有所帮助! :)

关于c# - 第一次访问缓存时出现 IsolatedStorage 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7640804/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com