WinStoreApp如何读取文本文件

        /**
         * 测试环境:
         * [1]Visual Studio 2013
         * [2]Win8.1 Store App
         * */
        public async void ReadHTMLFile()
        {
            Uri dataUri = new Uri("ms-appx:///Assets/HTMLPage1.html");//Build Action为Content
            StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(dataUri);
            String content = await FileIO.ReadTextAsync(file,Windows.Storage.Streams.UnicodeEncoding.Utf8);
            ...omit...
        }

你可能感兴趣的:(WinStoreApp如何读取文本文件)