【发布时间】:2015-03-05 12:07:27
【问题描述】:
我正在尝试从我的项目中读取一个 json 文件,但 vs 找不到它。当我使用.txt 扩展名时,一切正常,但是当我将扩展名更改为.json 时,则找不到文件
string fileContent;
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri(@"ms-appx:///Resources/Database/text.json"));
using (StreamReader sRead = new StreamReader(await file.OpenStreamForReadAsync()))
fileContent = await sRead.ReadToEndAsync();
“系统找不到指定的文件。(来自 HRESULT 的异常: 0x80070002)"
【问题讨论】:
标签: c# json file windows-phone-8 readfile