Hike
2010-01-22 08:38:01 UTC
Dear all,
I am trying to download ftp file. The following is a example reading one
file. My question is how to download all files(ex. *.txt) in the ftp folder.
Which method should I use?
BTW, when I use the WinAPI and WinInet, the function is working fine.
However, the task will be ran in batch in 64bit machine. It will cause a
exception error. Therefore, I need to try other solutions like this.
Thanks for your help in advance.
code:
System.Net.FtpWebRequest request;
System.Net.FtpWebResponse response;
System.Net.NetworkCredential credential;
Object ftpo;
ftpo = System.Net.WebRequest::Create("ftp://ftp.test.com/Readme.txt");
request = ftpo;
credential = new System.Net.NetworkCredential("username","passoword");
request.set_Credentials(credential);
request.set_Method("RETR");
response = request.GetResponse();
if (response)
info(response.get_StatusDescription());
I am trying to download ftp file. The following is a example reading one
file. My question is how to download all files(ex. *.txt) in the ftp folder.
Which method should I use?
BTW, when I use the WinAPI and WinInet, the function is working fine.
However, the task will be ran in batch in 64bit machine. It will cause a
exception error. Therefore, I need to try other solutions like this.
Thanks for your help in advance.
code:
System.Net.FtpWebRequest request;
System.Net.FtpWebResponse response;
System.Net.NetworkCredential credential;
Object ftpo;
ftpo = System.Net.WebRequest::Create("ftp://ftp.test.com/Readme.txt");
request = ftpo;
credential = new System.Net.NetworkCredential("username","passoword");
request.set_Credentials(credential);
request.set_Method("RETR");
response = request.GetResponse();
if (response)
info(response.get_StatusDescription());