Solved

Download a media file

Posted on 2009-05-10
11
199 Views
Last Modified: 2013-12-17
hi

I want the code for download the media filein C#
0
Comment
Question by:KaranGupta
  • 5
  • 3
11 Comments
 
LVL 6

Expert Comment

by:jaydee-cdgp
Comment Utility
0
 

Author Comment

by:KaranGupta
Comment Utility
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
 

Author Comment

by:KaranGupta
Comment Utility
Hi

Should I elaborate More
0
 
LVL 6

Expert Comment

by:jaydee-cdgp
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:KaranGupta
Comment Utility
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
 

Author Comment

by:KaranGupta
Comment Utility
Hi
Any Updates
0
 
LVL 6

Accepted Solution

by:
jaydee-cdgp earned 500 total points
Comment Utility
0
 
LVL 21

Expert Comment

by:MogalManic
Comment Utility
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
 

Author Comment

by:KaranGupta
Comment Utility
Is there any other method to do that
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now