Download a media file

hi

I want the code for download the media filein C#
KaranGuptaAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
jaydee-cdgpConnect With a Mentor Commented:
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
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
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.