Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //get actual photo
- var requestUserPhotoFile = client.Me.Photo.Content.Request();
- var resultUserPhotoFile = requestUserPhotoFile.GetAsync().Result;
- //create the file
- var profilePhotoPath = System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), "profilePhoto_" + resultsUserPhoto.Id + ".jpg");
- var profilePhotoFile = System.IO.File.Create(profilePhotoPath);
- resultUserPhotoFile.Seek(0, System.IO.SeekOrigin.Begin);
- resultUserPhotoFile.CopyTo(profilePhotoFile);
- Console.WriteLine("Saved file to: " + profilePhotoPath);
- Console.WriteLine("\nGraph Request:");
- Console.WriteLine(requestUserPhoto.GetHttpRequestMessage().RequestUri);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement