如何从FTP服务器读取文本文件

问题描述:

我想使用where condition来从FTP服务器读取文本文件。创建日期= '12 -03-2015'。读取仅在该日期创建的文件。

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.

您可以使用类 System.Net.FtpWebRequest

https: //msdn.microsoft.com/en-us/library/system.net.ftpwebrequest%28v=vs.110%29.aspx [ ^ ]。



查看可用于FTP的方法: https://msdn.microsoft.com/en-us/library/system.net.webrequestmethods.ftp%28v=vs.110%29.aspx [ ^ ]。



也许你需要从方法开始 ListDirectoryDe​​tails 。在第一个请求中使用它,查看HTTP响应并查看列表中的文件,解析它。等等...



-SA
You can use the class System.Net.FtpWebRequest:
https://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest%28v=vs.110%29.aspx[^].

Look at the methods you can use with FTP: https://msdn.microsoft.com/en-us/library/system.net.webrequestmethods.ftp%28v=vs.110%29.aspx[^].

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…

—SA