Suresh
Suresh

Reputation: 47

Downloading a file from url in c# windows forms

I have url like this

http://domainname.com/view/downloadfile?uname='ddd'&id=4

if we type the above url (not exactly the same ) in browser address bar it prompts open/save file dialog

my requirement is in button click without open/save dialog i need to download the file to my local disk location

Actually am working with webbrowser control .button is outside the webbrowser control

Upvotes: 0

Views: 5927

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039418

You could use the WebClient.DownloadFile method. Or if you don't want to save the file on the disk but manipulate it in memory you could use the WebClient.DownloadData method.

Upvotes: 1

Related Questions