Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to auto download files

Posted on 2008-10-29
5
Medium Priority
?
701 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 1200 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Suggested Courses

971 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