Click here to Skip to main content
15,906,628 members
Please Sign up or sign in to vote.
1.20/5 (2 votes)
See more:
I want to Read Text files from FTP Server using with where condition. Where Created Date='12-03-2015'. Read the files which are created only on that Date.
Sinisa Hajnal 12-Mar-15 2:55am    
What have you tried?
Robymon 12-Mar-15 3:09am    
I did search in google, all saying to read all files from FTP Server. I don't want to read all files only files which are created only on particular date
Tomas Takac 12-Mar-15 3:33am    
I guess you need to list the files first, pick those whit fitting dates and download them one by one. Show your code, explain where are you stuck, then you have better chances to get the help you need.
Robymon 12-Mar-15 3:53am    
I tried with this code. This one got from google, but this code is not working

using (Ftp client = new Ftp())

client.Connect(""); // or ConnectSSL for SSL
client.Login("user", "password");
List<ftpitem> items = client.GetList();
foreach (FtpItem item in items)
Console.WriteLine("Name: {0}", item.Name);
Console.WriteLine("Size: {0}", item.Size);
Console.WriteLine("Modify date: {0}", item.ModifyDate);
Console.WriteLine("Is folder: {0}", item.IsFolder);
Console.WriteLine("Is file: {0}", item.IsFile);
Console.WriteLine("Is symlink: {0}", item.IsSymlink);
Sergey Alexandrovich Kryukov 12-Mar-15 8:45am    
Perhaps you need to stop searching for code and start writing code.

1 solution

You can use the class System.Net.FtpWebRequest:[^].

Look at the methods you can use with FTP:[^].

Perhaps you need to start with the method ListDirectoryDetails. Use it in first request, look at the HTTP response and see what files are in the list, parse it. And so on…

Share this answer

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