I found all sorts of questions on these topics, but not one does not help me. Take a picture that I get using vk api https://pp.userapi.com/c625127/v625127790/2a520/DjJKxD7QOYA.jpg Reprobe many ways

WebClient client = new WebClient(); Uri uri = new Uri("https://pp.userapi.com/c625127/v625127790/2a520/DjJKxD7QOYA.jpg"); client.DownloadFileAsync(uri, "picture.jpg"); 

When opening the file, an error occurs: Windows Photo Viewer could not display this image because the file is empty.

Help, thanks in advance!

1 answer 1

 private async void button1_Click(object sender, EventArgs e) { WebClient client = new WebClient(); Uri uri = new Uri("https://pp.userapi.com/c625127/v625127790/2a520/DjJKxD7QOYA.jpg"); await Task.Run(() => client.DownloadFile(uri, "picture.jpg")); Process.Start("picture.jpg"); }