01.
using
System;
02.
using
System.Collections.Generic;
03.
using
System.IO;
04.
using
System.Linq;
05.
using
Windows.Devices.Geolocation;
06.
using
Windows.Foundation;
07.
using
Windows.Foundation.Collections;
08.
using
Windows.UI.Core;
09.
using
Windows.UI.Xaml;
10.
using
Windows.UI.Xaml.Controls;
11.
using
Windows.UI.Xaml.Controls.Primitives;
12.
using
Windows.UI.Xaml.Data;
13.
using
Windows.UI.Xaml.Input;
14.
using
Windows.UI.Xaml.Media;
15.
using
Windows.UI.Xaml.Navigation;
16.
17.
18.
19.
namespace
WindowsStoreApps
20.
{
21.
/// <summary>
22.
/// An empty page that can be used on its own or navigated to within a Frame.
23.
/// </summary>
24.
///
25.
26.
27.
public
sealed
partial
class
MainPage : Page
28.
{
29.
public
MainPage()
30.
{
31.
this
.InitializeComponent();
32.
}
33.
34.
protected
override
void
OnNavigatedTo(NavigationEventArgs e)
35.
{
36.
37.
}
38.
39.
private
async
void
btnSave_Click(
object
sender, RoutedEventArgs e)
40.
{
41.
string
myString =
this
.txtName.Text;
42.
43.
Windows.Storage.StorageFolder temporaryFolder = Windows.Storage.ApplicationData.Current.TemporaryFolder;
44.
45.
Windows.Storage.StorageFile sampleFile = await temporaryFolder.CreateFileAsync(
"dataFile.txt"
,
46.
Windows.Storage.CreationCollisionOption.ReplaceExisting);
47.
48.
await Windows.Storage.FileIO.WriteTextAsync(sampleFile, myString);
49.
}
50.
51.
private
void
btnGoPage2_Click(
object
sender, RoutedEventArgs e)
52.
{
53.
this
.Frame.Navigate(
typeof
(Page2));
54.
}
55.
56.
}
57.
}