Download a media file

hi

I want the code for download the media filein C#
KaranGuptaAsked:
Who is Participating?
 
jaydee-cdgpCommented:
0
 
KaranGuptaAuthor Commented:
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
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
KaranGuptaAuthor Commented:
Hi

Should I elaborate More
0
 
jaydee-cdgpCommented:
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.
0
 
KaranGuptaAuthor Commented:
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
0
 
KaranGuptaAuthor Commented:
Hi
Any Updates
0
 
MogalManicCommented:
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
0
 
KaranGuptaAuthor Commented:
Is there any other method to do that
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.