通过C#.Net发送时的SFTP或FTPS(SFTP or FTPS when sending via C#.Net)
我读了这篇文章:
这两者彼此非常不同,尽管它们都旨在服务于同一目的。 SFTP使用单个通道发送和接收所有相关数据,而FTPS使用另一个动态决定数据的通道。 FTPS在通过防火墙时经常遇到问题,因为它不知道数据正在使用的端口,并且无法允许通过端口的流量。 FTPS以文本格式发送消息,允许人们读取日志并确定会话期间发生的事情。 SFTP无法做到这一点,因为消息不是文本,而是二进制。
阅读更多:FTPS和SFTP之间的区别| |之间的区别 FTPS与SFTP http://www.differencebetween.net/technology/internet/difference-between-ftps-and-sftp/#ixzz20KUGWr00
我不想假设任何事情,因为如果我错了,这会让我的工作变得更难,但是当我通过C#/ .Net4发送文件时,这样:
var request = (FtpWebRequest) WebRequest.Create(FtpUrl + filename); request.Method = WebRequestMethods.Ftp.UploadFile; var secureString = new SecureString(); foreach (var b in Encoding.Default.GetBytes(FtpPassword)) secureString.AppendChar((char) b); request.Credentials = new NetworkCredential(FtpUsername, secureString); request.EnableSsl = true;
那是SFTP还是FTPS? 由于EnableSsl,我假设FTPS正如文章所示。
如果不是SFTP,我可以将其更改为SFTP吗? 我在通过防火墙发送时遇到问题。
谢谢!
I read this article:
The two are very different from each other, although they both aim to serve the same purpose. SFTP uses a single channel to transmit and receive all the pertinent data, while FTPS uses another channel that is dynamically decided for the data. FTPS often had problems when passing through a firewall, as it did not know the port that was being used by the data, and failed to allow traffic through the port. FTPS sends messages in a text format, allowing people to read logs and determine what happened during the session. This is not possible with SFTP, as the messages are not in text, but in binary.
Read more: Difference Between FTPS and SFTP | Difference Between | FTPS vs SFTP http://www.differencebetween.net/technology/internet/difference-between-ftps-and-sftp/#ixzz20KUGWr00
I didn't want to assume anything as this would just make my job harder if I am wrong but when I am sending a file through C#/.Net4 like this:
var request = (FtpWebRequest) WebRequest.Create(FtpUrl + filename); request.Method = WebRequestMethods.Ftp.UploadFile; var secureString = new SecureString(); foreach (var b in Encoding.Default.GetBytes(FtpPassword)) secureString.AppendChar((char) b); request.Credentials = new NetworkCredential(FtpUsername, secureString); request.EnableSsl = true;
Is that going SFTP or FTPS? I am assuming FTPS as the article indicates due to the EnableSsl.
If it is not SFTP, can I change this to be SFTP instead? I'm having problems sending through a firewall.
Thanks!
原文:https://stackoverflow.com/questions/11436561
最满意答案
$(document).on('change','.chkView',function(){ var row = $(this).closest('tr'); if($(this).is(':checked')) { $(row).find('.chkEdit,.chkDelete').prop("disabled",false); } else { $(row).find('.chkEdit,.chkDelete').prop("disabled",true); } });
你错过了'。' 在选择器类中。
演示:
$(document).on('change','.chkView',function(){ var row = $(this).closest('tr'); if($(this).is(':checked')) { $(row).find('.chkEdit,.chkDelete').prop("disabled",false); } else { $(row).find('.chkEdit,.chkDelete').prop("disabled",true); } });
You are missing '.' in the selector class.
Demo:
相关问答
更多-
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
WPF启用/禁用控件(WPF enable/disable controls)[2021-11-14]
是通过使用命令。 MenuItems和Buttons有一个命令属性。 Command是ICommand接口的一个实现,它有一个名为CanExecute的方法。 如果返回true,则可以调用执行时,启用menutitem或按钮,否则它将变为灰色。 MSDN命令概述 有关设置命令的简单教程 谷歌搜索 :) yes by using commands. MenuItems and Buttons have a command property. a Command is an implementation of ... -
使用列的名称作为单元格集合中的索引器来访问行单元格的值。 然后可以使用Form(Me)控件集合来查找相对控件 Public Sub EnablePictures() Dim Enable As Boolean For Each row As DataGridViewRow In DataGridView1.Rows Enable = Convert.ToBoolean(row.Cells("Access").Value) Dim ctrl = Me.Contr ...
-
为了以角度隐藏和显示元素,我认为你应该使用内置指令ng-show , ng-hide或ng-if 。 顾名思义, ng-show和ng-hide根据提供的表达式显示或隐藏元素。 请注意,他们仍然在DOM中,他们现在只是不可见。 ng-if从DOM中插入或删除元素,而不是显示或隐藏。 要禁用该行,可以使用ng-disabled指令。 所以,在你的代码中,你可以使用: