Click here to Skip to main content
14,336,321 members
Rate this:
Please Sign up or sign in to vote.
See more:
In a WPF project I use the method


to get a PNG picture from the server. Following dialog appears:

"File download" / "Do you want to open or save this file?"

How to get rid of this dialog by dowloading the picture silently?

What I have tried:

I've tried to use some Registry settings in
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl
Updated 3-Apr-19 0:18am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Why not using the System.Net.WebClient?

var webClient = new WebClient();
webClient.DownloadFile(new Uri(""), @"c:\temp\google.png");

will download the Google logo and save it as google.png on your hard drive without asking any questions.
_duDE 3-Apr-19 7:51am
Thank you for the answer! I need to SHOW this picture in the WebBrowser control. This control is basically the simple IE window, that can both things: download AND show the picture.
The idea to use WebClient is nice (+1) but not exactly what I need :(
TheRealSteveJudge 3-Apr-19 8:07am
You're welcome. I just tried this:

and it showed the Google logo in the web browser control without any dialogue.
_duDE 3-Apr-19 10:58am
Yes, I have this problem only on some systems: it may be a strange Registry setting but I cannot find which exactly ...
Richard Deeming 4-Apr-19 11:38am
Do you really need to show it in a WebBrowser control? Or do you just want to show it somehow?

Both the WPF Image control and the BitmapImage class can load images directly from a URL.

<Image Source="" />
_duDE 5-Apr-19 4:21am
Thank you, Richard! Nice idea, I will try it!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100