Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I want to copy zip file from remote server to local machine in console application with c# dot net 3.5.

If any one have code for it please share with me .

Thank in advance...
Posted
Comments
Zoltán Zörgő 8-Dec-12 13:51pm    
It depends how do you intend to access the remote server. SAMBA, FTP, HTTP.....?

1 solution

Here's one way...from:
http://www.csharp-examples.net/download-files/

C#
using System.Net;

WebClient webClient = new WebClient();
webClient.DownloadFile("http://mysite.com/myfile.zip", @"c:\myfile.zip");


Have a look at the referenced web page for more info.
 
Share this answer
 
Comments
nirmala Gudur 16-Jul-13 7:50am    
Hi,

I am new to C# ..please help me if we want to download the files from the remote server and copy it to my Local folder.

Suppose i ahve a server abcdefghhjhjk and username -test and password -test
i want to connect to this server and and get the files present in C:\ folder with the zip extension and copy it to my Local folder.

Please help me out its urgent.

Thansk in advance
Regards,
Nirmala.Gudur
cigwork 16-Jul-13 15:02pm    
If the server holding the files can be configured as an FTP server then you can use
WevRequestMethods.Ftp.DownloadFile see:

http://msdn.microsoft.com/en-us/library/system.net.webrequestmethods.ftp.downloadfile.aspx

Have a look at this Code Project article based on framework 2
http://www.codeproject.com/Articles/17202/Simple-FTP-demo-application-using-C-Net-2-0

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900