3
所以我想用這段代碼創建一個簡單的文本文件。 但是,當我打開創建的文件,文本不完全顯示, 我得到的唯一文本是從tb1.text(id [2])。writetextasync不會將所有文本寫入文件
這裏有什麼不對嗎?
private async void Save_Reg()
{
var myfile = (tb3.Text+".xml");
var folderUsed = ApplicationData.Current.LocalFolder;
var folderOp = Windows.Storage.CreationCollisionOption.ReplaceExisting;
var createFile = await folderUsed.CreateFileAsync(myfile, folderOp);
var password = tb2.Text;
var recov = tb1.Text;
string[] id = { myfile,password, recov };
await Windows.Storage.FileIO.WriteTextAsync(createFile, id[0]);
await Windows.Storage.FileIO.WriteTextAsync(createFile, id[1]);
await Windows.Storage.FileIO.WriteTextAsync(createFile, id[2]);
}
作品像魅力,感謝:D –