ftpwebrequest - How to Download Numerous Files from FTP using C#? -


i need run console application @ scheduled intervals needs download .pgp files ftp site. pgp file in ftp must downloaded. i've found sample code directory listing of ftp , have written here:

ftpwebrequest req = (ftpwebrequest)webrequest.create("ftp://ourftpserver");         req.method = webrequestmethods.ftp.listdirectorydetails;          req.credentials = new networkcredential("user", "pass");          ftpwebresponse response = (ftpwebresponse)req.getresponse();          stream responsestream = response.getresponsestream();         streamreader reader = new streamreader(responsestream);         console.writeline(reader.readtoend());          console.writeline("directory list complete, status {0}", response.statusdescription);          reader.close();         response.close(); 

what must download files of type .pgp directory listing , save them in local directory on our server?

the ftpwebrequest , ftpwebresponse objects designed make single requests (i.e. download single files, etc.)

you're looking ftp client. there isn't 1 in .net framework, there's free one, system.net.ftpclient apparently works quite well.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -