KaranGupta
asked on
Download a media file
hi
I want the code for download the media filein C#
I want the code for download the media filein C#
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
when downloading it didn't ask for the location at runtime where you want to save the file.
Is that possible
ASKER
Hi
Should I elaborate More
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.
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.
ASKER
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
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
ASKER
Hi
Any Updates
Any Updates
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.Messa geBox class
http://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox(VS.80).aspx
If you want a prompt, use the System.Windows.Forms.Messa
http://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox(VS.80).aspx
ASKER
Is there any other method to do that
http://www.aspfree.com/c/a/Code-Examples/File-download-using-C/