Front-end code: <Canvas Background = "{StaticResource AppBarBackgroundThemeBrush}"> <TextBox Name = "txtContent" Width = "1365" Height = "696" TextWrapping = "Wrap" FontSize = "18" Canvas. top = "1"/> <Button Content = "Save to file" Canvas. left = "710" FontSize = "15" Canvas. top = "702" Padding = "0.844" Click = "btnSave_Click" RenderTransformOrigin =, 0.395 "Height =" 60 "/> <TextBlock Name =" Msg "FontSize =" 20 "Canvas. left = "1015" Canvas. T Op = "722" RenderTransformOrigin = "-1.207, 0.583"/> <TextBox TextWrapping = "Wrap" Text = "multi-grid file storage is supported, you can write diaries, Word, Txt, and so on... for convenient user writing, come and try "Canvas. top = "712" Width = "574" Canvas. left = "10" Height = "46"/> </Canvas> </Page> background code: using System; using System. collections. generic; using System. IO; using System. linq; using Windows. foundation; using Windows. foundation. collections; using Windows. UI. xaml; using Windows. UI. xaml. cont Rols; using Windows. UI. xaml. controls. primitives; using Windows. UI. xaml. data; using Windows. UI. xaml. input; using Windows. UI. xaml. media; using Windows. UI. xaml. navigation; using Windows. storage; using Windows. storage. pickers; // "blank page" item template in http://go.microsoft.com/fwlink? Link id = 234238 describes how to choose to save the file {// <summary> /// for namespace, or navigate to a blank page inside the Frame. /// </Summary> public sealed partial class MainPage: Page {public MainPage () {this. initializeComponent ();} private async void btnSave_Click (object sender, RoutedEventArgs e) {if (this.txt Content. text. equals (string. empty) {return;} FileSavePicker picker = new FileSavePicker (); // The text picker displayed on the submit button. commitButtonText = "save"; // supported file type picker. fileTypeChoices. add ("text file", new string [] {". txt "} ); Picker. fileTypeChoices. add ("Word Document", new string [] {". doc "}); picker. fileTypeChoices. add ("WordPad", new string [] {". rtf "}); picker. fileTypeChoices. add ("document template", new string [] {". dot "}); picker. fileTypeChoices. add ("WPS", new string [] {". wps "}); picker. fileTypeChoices. add ("Word platform", new string [] {". wpt "}); picker. fileTypeChoices. add ("webpage", new string [] {". html "}); picker. fileTypeChoices. ad D ("data", new string [] {". data "}); picker. fileTypeChoices. add ("Database", new string [] {". dbf "}); picker. fileTypeChoices. add ("Diary", new string [] {". jnt "}); picker. fileTypeChoices. add ("extensible identification language", new string [] {". xml "}); // default display directory picker. suggestedStartLocation = PickerLocationId. desktop; // display the UI and return the StorageFile file = await picker. pickSaveFileAsync (); // write content to the file if (file! = Null) {await FileIO. WriteTextAsync (file, txtContent. Text, Windows. Storage. Streams. UnicodeEncoding. Utf8); this. Msg. Text = "the file is saved. ";}}}}