如何阅读越来越多使用c#文件从linux机器How to read a growing file from a linux machine using c#

- 此内容更新于:2015-01-06
主题:

我有一个c#应用程序需要读取日志文件生成的Linux应用程序,它不断持续增长。参考http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx,但我没能找到一个方法来完成它。

原文:

I have a c# application which needs to read a log file that is generated by a Linux application and it continuously keeps growing. I got a reference at http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx but i was not able to find a way to get it done.

解决方案:
使用ftp可以发送ftp-webrequest WebRequestMethods.Ftp。GetDateTimestamp到服务器。你也可以运行。Net代码与Linux机器上mono。请尝试使用。文件类方法GetLastWriteTime(文件)和GetLastAccessTime(文件)。mono的linux机器。Net代码应该工作。
原文:

Using a ftp you can send a ftp-webrequest with WebRequestMethods.Ftp.GetDateTimestamp to the server. Also you can run your .Net code with mono on the Linux machine. try using the System.IO.File classes methods GetLastWriteTime(file) and GetLastAccessTime(file). With mono on the linux machine this .Net code should work.

解决方案:
尝试使用SSH。网: https://sshnet.codeplex.com/ 然后你可以使用SSH / SCP和SFTP命令得到你 需要从您的linux机器
原文:

try using SSH.Net from: https://sshnet.codeplex.com/ then you will be able to use SSH/SCP/SFTP commands to get what you need from your linux machine