isolatedStorageFile.GetUserStoreForApplication().AvailableFreeSpace 是错误的吗?
最近,我在将大量数据下载到 WP7 设备上的隔离存储时遇到了问题,下载过程中会丢失大量可用空间。
更具体地说,我在下载之前检查了可用空间,比方说,它是 1.8 GB;然后我开始下载,当我达到大约 1.1 GB 时,我收到一个磁盘空间不足的警告弹出窗口,不久之后写入磁盘失败并出现 IOException。
因此,某些东西占用了我的设备 (HTC Mozart 7) 上大约 700 MB 的空间。通过我所有的测试,这个值似乎是一致的。
此外,在引发 IOException 后,IsolatedStorageFile.GetUserStoreForApplication().AvailableFreeSpace 返回接近于零,因此显然是存储已满的情况。
任何额外的信息/提示将不胜感激。
谢谢!
I have recently come across a problem downloading large amounts of data to isolated storage on a WP7 device, when significant amounts of free space are lost during download.
More specifically, I check the free space before downloading and it is, let's say, 1.8 GB; then I start downloading and when I get to about 1.1 GB I get a low disk space warning popup, and soon thereafter writing to disk fails with an IOException.
So something is taking up about 700 MB of space on my device (HTC Mozart 7). This value seems consistent through all my tests.
Also, IsolatedStorageFile.GetUserStoreForApplication().AvailableFreeSpace returns close to zero after the IOException is raised, so it's clearly the case of storage being full.
Any additional information/tips would be appreciated.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这绝对是缓存抢占磁盘空间。要传输如此大量的数据,您应该考虑 HTTP 以外的协议,毕竟它最初仅用于网页下载。我个人会考虑 ftp,否则您将不得不考虑将数据拆分为更易于管理的块。
This is definitely caching grabbing disk space. For shifting such large amounts of data you should be looking at a protocol other than HTTP, after all it was originally only intended for web page download. I personally would be looking at ftp, otherwise you'll have to look into splitting your data into more manageable chunks.
您是否使用 HttpWebRequest 下载文件?如果是这样,请尝试设置 HttpWebRequest.AllowReadStreamBuffering 属性设置为 false。默认为 true。
您应该阅读该属性文档的“备注”部分,看看将其设置为 false 是否符合您的应用程序的需求,因为它会影响回调发生的时间。
Are you using HttpWebRequest to download the files? If so, please try setting the HttpWebRequest.AllowReadStreamBuffering property to false. The default is true.
You should read the Remarks section of the documentation for that property to see if setting this to false matches your application's needs, since it affects when callbacks occur.
我觉得它失败了,因为您已经超过了您在 zune 中为设备设置的阈值限制。请参考下面的屏幕截图。如果发生这种情况,请重新检查该值并重试。另请注意,即使将其设置为 0%,手机仍保留约 300-500MB
I feel its failing because you have crossed the threshold limit you might have set for your device in zune. Please refer the screenshot below. If that is whats happening recheck that value and try again. Also note that even after setting it 0% the phone still reserves about 300-500MB