You can link to files in the application package using URLs in the form:
ms-appx:
( , / - , )
, JSON, Windows.Storage. - StorageFile, , JSON. , :
var url = new Windows.Foundation.Uri("ms-appx:///data/data.json");
Windows.Storage.StorageFile.getFileFromApplicationUriAsync(url).then(function (file) {
Windows.Storage.FileIO.readTextAsync(file).then(function (text) {
var parsedObject = JSON.parse(text);
});
});
, , FileIO . , JSON. , , :
var url = new Windows.Foundation.Uri("ms-appx:///data/data.json");
Windows.Storage.StorageFile.getFileFromApplicationUriAsync(url).then(function (file) {
Windows.Storage.FileIO.readLinesAsync(file).then(function (lines) {
lines.forEach(function (line) {
var parsedObject = JSON.parse(line);
});
});
});
, FileIO.readLinesAsync , JSON.