Solved

How to auto download files

Posted on 2008-10-29
5
667 Views
Last Modified: 2012-05-05
Hi

I want to write a program that auto downloads files, if necessary, to a certain folder. I do not want the save dialog box appearing  to ask user where to save the file to, instead I wish the file would be automatically download to like c:\MyDownload folder. How to do this or at least what technology involves in?

Thanks

Peter
0
Comment
Question by:petershaw9
  • 2
5 Comments
 
LVL 12

Expert Comment

by:jandromeda
ID: 22837514
0
 
LVL 12

Accepted Solution

by:
jandromeda earned 300 total points
ID: 22837571
Here is a sample code.
try
			{
				WebClient client = new WebClient();
				client.DownloadFile(@"http://www.tnpsc.com/downloads/NaturesScenery.jpg",
				                    @"C:\photo.jpg");
			}
			catch (Exception e)
			{
				Console.WriteLine(e.Message);
			}

Open in new window

0
 

Author Comment

by:petershaw9
ID: 23188646
very good. thank u.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Device Location 4 29
Question! 4 36
Moving code from one TFS branch to another 3 25
jQuery - following an example but can I save data server side? 20 46
New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

776 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