View difference between Paste ID: cqixGRHr and vpPSg1wt
SHOW: | | - or go back to the newest paste.
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
using System.Runtime.CompilerServices;
7
8
using Windows;
9
using Windows.Foundation;
10
using Windows.Foundation.Collections;
11
using Windows.Storage.Pickers;
12
using Windows.Storage;
13
using Windows.Storage.Streams;
14
using Windows.UI.Xaml.Media.Imaging;
15
using Windows.System.UserProfile; 
16
17
namespace useraccountpicture_win8{
18-
    class Program{
18+
	class Program{
19-
        static void Main(string[] args){
19+
		static void Main(string[] args){
20-
			ChangePic().AsTask().Wait();
20+
			ChangePic().Wait();
21
		}
22-
		private static async void ChangePic() {
22+
		private static async Task ChangePic() {
23
			string location = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
24
			StorageFile img = await StorageFile.GetFileFromPathAsync(location + "grad_hat_lighting.png");
25
26
			if (img != null) {
27
				SetAccountPictureResult result = await UserInformation.SetAccountPicturesAsync(null, img, null);
28
			}
29
		}
30
31-
    }
31+
	}
32
}