Create file
Can anyone help me to do a task that to create a txt file(ie, data entered in a text box) by a button click in windows store app? Need codes..
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Suresh MRank #171 · 14K reputationPosted Jun 11, 2014, 2:35 AM EDT
first you need to create text file for that use below code
StorageFile file=await StorageFolder.CreateFileAsync("Sample.txt",CreationCollisionOption.ReplaceExisting);
Next Write the below code for writing data to your text file
await FileIO.WriteTextAsync(file,TextBox1.Text);