【发布时间】:2015-06-14 12:49:53
【问题描述】:
我正在尝试从 .NET 4.5 for Windows Phone 应用程序中的 json 文件中读取数据。按下按钮后出现异常:
System.IO.FileNotFoundException (Exception from HRESULT: 0x80070002)
我的代码:
public static async Task ReadFile()
{
StorageFolder local = Windows.ApplicationModel.Package.Current.InstalledLocation;
if (local != null)
{
var file = await local.OpenStreamForReadAsync("bazaDanych.json");
using (StreamReader streamReader = new StreamReader(file))
{
json = streamReader.ReadToEnd();
}
}
}
这是我对解决方案资源管理器的看法:
【问题讨论】:
标签: c# .net windows-phone-8.1 storagefolder