如何从FTP服务器读取文本文件 [英] How to Read Text files from FTP Server
本文介绍了如何从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 [ ^ ]。
也许你需要从方法开始ListDirectoryDetails
。在第一个请求中使用它,查看HTTP响应并查看列表中的文件,解析它。等等...
-SA
You can use the classSystem.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 methodListDirectoryDetails
. Use it in first request, look at the HTTP response and see what files are in the list, parse it. And so on…
—SA
这篇关于如何从FTP服务器读取文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文