如何使用C#套接字从linux服务器目录中提取文件。 [英] How to extract files from linux server directory using C# socket.

查看:110
本文介绍了如何使用C#套接字从linux服务器目录中提取文件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我们要求在某些路径上在Linux服务器中生成一些文件。

我们需要创建.net c#中的一个工具,它从Linux服务器中提取文件。我们可以通过在C#中使用套接字编程来解决这个问题。



非常感谢您的帮助。 />


我尝试了什么:



我通过使用asp试试这个。 net core但我们不能使用asp.net核心框架。所以我们必须以其他方式工作。

Hi All,

We have a requirement in which some files are generated in Linux server at some path.
We need create a tool in .net c# which extract files from that Linux server.Can we solve this problem by using socket programming in C#.

Your help is very appreciated.

What I have tried:

I have try this by using asp.net core but we can not use asp.net core framework.So We have to work in other way.

推荐答案

你可以FTP到/从Linux服务器。



您只需要一个IP地址和目录信息(当然还有登录功能)。
You can FTP to / from a Linux server.

You just need an IP address and directory info (and "login" capabilities, of course).


使用单声道 [ ^ ]!它为所有平台支持(包括) FileSystemWatcher ;)



Use Mono[^] on Linux Server! It supports (includes) FileSystemWatcher for all platforms ;)

引用:

FileSystemWatcher有什么问题?



FileSystemWatcher的Mono实现有一个数字后端,最优的一个,依赖性较小的后端是inotify-backend(在Mono 1.1.17和更新的版本中可用)。



有了这个后端内核为Mono提供了对文件系统上文件的任何更改的更新,但它需要一个启用inotify的内核,只有较新的Linux发行版才能发布。



在较旧的Linux系统中,你必须安装FAM或Gamin(它可以与任何一个一起使用)。您可能需要安装-devel数据包。



对于* BSD系列,有一个基于Kqueue的实现,将在运行时检测到时使用。



如果以上都不起作用,Mono会回退到轮询目录中进行更改,这远非最佳。

What are the issues with FileSystemWatcher?

The Mono implementation of FileSystemWatcher has a number of backends, the most optimal one, the one with fewer dependencies is the inotify-backend (available in Mono 1.1.17 and newer versions).

With this backend the kernel provides Mono with updates on any changes to files on the file system but it requires an inotify-enabled kernel, which only newer Linux distributions ship.

In older Linux systems, you must have installed FAM or Gamin (it will work with either one). You might need the -devel packets installed.

For the *BSD family, there’s a Kqueue based implementation that will be used when detected at runtime.

If none of the above work, Mono falls back to polling the directories for changes, which far from optimal.


这篇关于如何使用C#套接字从linux服务器目录中提取文件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆