Link to home
Start Free TrialLog in
Avatar of KaranGupta
KaranGupta

asked on

Download a media file

hi

I want the code for download the media filein C#
Avatar of jaydee-cdgp
jaydee-cdgp
Flag of Australia image

Avatar of KaranGupta
KaranGupta

ASKER

In the first article on which Webclient is used

when downloading it didn't ask for the location at runtime where you want to save the file.

Is that possible
Hi

Should I elaborate More
Use DownloadFile()

There are two ways of downloading a file from a web site using WebClient, depending on whether we want to save the file, or process the contents of the directly within your application. If we simply want to save the file then we should call the DownloadFile() method takes two parameters, The URL from where we want to retrieve the file, and the file name ( or path) that we want to save the file to.
Hi

I have used the following code from the website

WebClient Client = new WebClient();
Client.DownloadFile("http://www.csharpfriends.com/Members/index.aspx", " index.aspx");

But this code will directly download the file
Hi
Any Updates
ASKER CERTIFIED SOLUTION
Avatar of jaydee-cdgp
jaydee-cdgp
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm confused.  You want to download a file, but WebClient.DownloadFile() (which downloads it) doesn't prompt you.

If you want a prompt, use the System.Windows.Forms.MessageBox class
http://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox(VS.80).aspx
Is there any other method to do that