Creating Text File in Library

Creating text file in library:

/// using system;

public MainPage()

{

this.InitializeComponent();

}

 

/// <summary>

/// Invoked when this page is about to be displayed in a Frame.

/// </summary>

/// <param name="e">Event data that describes how this page was reached. The Parameter

/// property is typically used to configure the page.</param>

 

protected override void OnNavigatedTo(NavigationEventArgs e)

{

}

 

private async void button1_Click(object sender, RoutedEventArgs e)

{

StorageFolder storefolder = KnownFolders.DocumentsLibrary;

StorageFile testfile = await storefolder.CreateFileAsync("abhi.txt",CreationCollisionOption.ReplaceExisting);

await FileIO.WriteTextAsync(testfile, "hello C#");

}

}

}