简体   繁体   English

在.NET C#程序中,从FTP过渡到SFTP容易吗?

[英]In a .NET C# program, is it easy to transition from FTP to SFTP?

In a .NET C# program, is it easy to transition from FTP to SFTP? 在.NET C#程序中,从FTP过渡到SFTP容易吗? I'm trying to get a sense of how muh time it would take the contractor to make the transition. 我试图了解承包商需要多长时间才能完成过渡。 My personal experience is mostly with PHP, so I have no idea. 我的个人经验主要是使用PHP,因此我一无所知。

Basically, what I'm talking about, what steps would have to be made? 基本上,我在说什么,必须采取什么步骤? Obviously, different commands, but would anything else in the code itself? 显然,命令不同,但是代码本身还有其他内容吗? Like do the commands require different formats, etc.? 就像命令需要不同的格式等吗?

Also, if anyone has a list of all the .NET/C# FTP and SFTP commands, that would be really helpful. 另外,如果任何人都有所有.NET / C#FTP和SFTP命令的列表,那将非常有帮助。

Clarification, as requested: The program is uploading extremely small files (20 KB) to a server. 根据要求进行的澄清:该程序正在将非常小的文件(20 KB)上传到服务器。 By format, I mean visually, because I was wondering about a find/replace job. 格式是视觉上的意思,因为我想知道查找/替换作业。

This is a pretty vague question. 这是一个非常模糊的问题。 You haven't told us what the C# program is doing with FTP. 您尚未告诉我们C#程序对FTP进行的操作。 Is it a server, is it a client, is it doing directory listings, is it uploading 100 GB files? 它是服务器,还是客户端,是否正在执行目录列表,是否正在上传100 GB的文件? What library is it using? 它使用什么库?

According to this forum post , there is no built-in support for SFTP in .NET, so you would have to use third-party libraries such as SharpSSH or Granados SSH . 根据此论坛帖子 ,.NET中没有对SFTP的内置支持,因此您将不得不使用第三方库,例如SharpSSHGranados SSH

I don't really know what you mean, "do the commands require different formats". 我真的不明白您的意思是“命令需要不同的格式”。 Obviously, the code will use different: 显然,代码将使用不同的代码:

  1. Libraries 图书馆
  2. Types 类型
  3. Wire protocol. 有线协议。

It will obviously appear somewhat similar, thanks to the abstraction of the libraries. 显然,由于库的抽象,它看起来会有些相似。 I suggest you provide more information, and a clearer question. 我建议您提供更多信息,并提出一个更明确的问题。

One thing that you'd need to consider is how well your current code is written. 您需要考虑的一件事是当前代码的编写程度。 If your existing FTP implementation is horribly designed spaghetti code then converting it to SFTP may be next to impossible and take way longer than you'd like. 如果您现有的FTP实现是经过精心设计的意大利细面条代码,那么将其转换为SFTP可能几乎是不可能的,并且花费的时间比您想要的长。 Without knowing the current state of the code, it would be difficult for anyone to make a good estimation. 如果不知道代码的当前状态,那么任何人都很难做出良好的估算。 And even if you do get an estimation from people on this site, I wouldn't recommend trusting it (even though the people on this site are great) since without all the information in front of them it will be next to impossible for anyone to come up with a reliable estimate. 而且即使您确实从该站点上的人员那里得到了一个估计,我也不建议您信任它(即使此站点上的人员很棒),因为如果没有他们面前的所有信息,任何人几乎都不可能做到这一点。提出一个可靠的估计。

Perhaps you should consider hiring a good consultant or business analyst to do a thorough estimate for you. 也许您应该考虑聘请一位优秀的顾问或业务分析师来为您做一个全面的估算。

I've been down this road. 我一直走这条路。

It depends, but keep in mind that SFTP, FTP-SSL and FTP are different. 这要视情况而定,但请记住,SFTP,FTP-SSL和FTP是不同的。 If he's writing the SFTP libraries himself, a month or two, since it's a lot of work to make it perfect and compatible. 如果他自己编写SFTP库,则需要一两个月的时间,因为要使其变得完美且兼容,需要进行大量的工作。 But he should NOT do that. 但是他不应该那样做。

In short, get him to use an external library to add SFTP functionality. 简而言之,请他使用外部库来添加SFTP功能。 This will make it pretty short. 这将使其很短。 Maybe a week or two of full-time work, but it depends on how involved it is. 也许需要一两个星期的全职工作,但是要取决于工作的参与程度。 There's open-source options.. But for $50-150 you can get a license to well-maintained code that's really easy to use. 有开放源代码的选项。但是,只要花50至150美元,您就可以获得许可证,可以很好地使用维护良好的代码。 will save him days of work. 将节省他的工作时间。 There's links above, but I'd look at: Free: http://www.enterprisedt.com/products/edtftpnet/overview.html 上面有链接,但我要看一下:免费: http : //www.enterprisedt.com/products/edtftpnet/overview.html

Commercial: http://www.weonlydo.com/ 商业广告: http//www.weonlydo.com/

It really depends on what C# library your developer has used to implement FTP. 这实际上取决于您的开发人员用来实现FTP的C#库。

If, for example, they used edtFTPnet , a widely available open source library, then the upgrade path is trivial if you replace it with edtFTPnet/PRO . 例如,如果他们使用edtFTPnet (一个广泛使用的开源库),则如果将其替换为edtFTPnet / PRO ,升级路径将变得很简单。 The PRO version has the identical API and just a few extra lines of code would be needed. PRO版本具有相同的API,仅需要几行代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM