Guest User

Untitled

a guest
Nov 19th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Runtime.InteropServices.WindowsRuntime;
  6. using Windows.Foundation;
  7. using Windows.Foundation.Collections;
  8. using Windows.UI.Xaml;
  9. using Windows.UI.Xaml.Controls;
  10. using Windows.UI.Xaml.Controls.Primitives;
  11. using Windows.UI.Xaml.Data;
  12. using Windows.UI.Xaml.Input;
  13. using Windows.UI.Xaml.Media;
  14. using Windows.UI.Xaml.Navigation;
  15. using System.Threading.Tasks;
  16. using Windows.Storage;
  17. using System.Xml.Linq;
  18.  
  19. namespace App1
  20. {
  21. /// <summary>
  22. /// それ自体で使用できる空白ページまたはフレーム内に移動できる空白ページ。
  23. /// </summary>
  24. public sealed partial class MainPage : Page
  25. {
  26. public MainPage()
  27. {
  28. this.InitializeComponent();
  29. }
  30.  
  31. private async void btnRead_Click(object sender, RoutedEventArgs e)
  32. {
  33. var xd = await GetXdoc();
  34. lblMsg.Text = xd.ToString();
  35. }
  36.  
  37. static async Task<XDocument> GetXdoc()
  38. {
  39. return await Task.Run(() => {
  40. StorageFolder appFolder = ApplicationData.Current.LocalFolder;
  41.  
  42. string path = @"quiz.xml";
  43. return XDocument.Load(path);
  44. });
  45. }
  46. }
  47. }
Add Comment
Please, Sign In to add comment