私は何時間も頭を悩ませ、MSDN と Windows Dev Center で見つけることができるチュートリアルを (何度も) 読んでいます。何も機能していません。
プレーンテキストファイルからデータを読み取れないようです!
はい、ファイルの関連付けを追加しました。はい、プロジェクトに宣言を追加しました。
msdn からのコード:
(function () {
"use strict";
WinJS.UI.Pages.define("/pages/home/home.html", {
// This function is called whenever a user navigates to this page. It
// populates the page elements with the app's data.
ready: function (element, options) {
// TODO: Initialize the page here.
Windows.Storage.FileIO.readTextAsync("AvailableBalance.sv").then(function (contents) {
// Add code to process the text read from the file
document.getElementById("AvailableBalanceText").innerText = contents;
});
}
});
});
と:
<h1 id="AvailableBalanceText"></h1>
動作しません。アプリは正常に読み込まれますが、ファイルから読み取られない (またはデータが表示されない) だけです。
誰かが私がここで間違っていることを教えてもらえますか?