0
普通でC# console app
私は簡単にテキストファイルから文字列を取得し、テキストの各単語でリストを作ることができるように操作することができます。windows phone 8.1 sdk
これはコンソールアプリケーションとまったく同じものを使用していません。Windows phone 8.1文字列ストリームのリストを作成するには?
*目標:txtファイルとstring.split(',').tolist()
からデータを取得します。
private async Task WriteToFile()
{
// Get the text data from the textbox.
byte[] fileBytes = System.Text.Encoding.UTF8.GetBytes(this.textBox1.Text.ToCharArray());
// Get the local folder.
StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
// Create a new folder name DataFolder.
var dataFolder = await local.CreateFolderAsync("DataFolder",
CreationCollisionOption.OpenIfExists);
// Create a new file named DataFile.txt.
var file = await dataFolder.CreateFileAsync("DataFile.txt",
CreationCollisionOption.ReplaceExisting);
// Write the data from the textbox.
using (var s = await file.OpenStreamForWriteAsync())
{
var test1 = s.ToString().ToList();
s.Write(fileBytes, 0, fileBytes.Length);
var wtf = s.Split(',').ToList();
var Kuma = file.ToString();
this.textBlock1.Text = wtf[0];
}
}