Dart.Ftp 名前空間 > FtpSecurity クラス : EncryptData プロパティ |
<DefaultValueAttribute()> Public Property EncryptData As Boolean
[DefaultValue()] public bool EncryptData {get; set;}
private void explicitLogin() { // 明示的なセキュリティを使用してサーバーに接続します。 ftp1.Session.RemoteEndPoint.HostNameOrAddress = myServer; ftp1.Session.Username = myUsername; ftp1.Session.Password = myPassword; ftp1.Session.Security.EncryptControl = EncryptControl.Explicit; ftp1.Session.Security.EncryptData = true; ftp1.Session.Security.ValidationCallback = remoteCertificateValidation; ftp1.Connect(); ftp1.Authenticate(); ftp1.List("", "", ListType.Full); ftp1.Close(); } private bool remoteCertificateValidation(Object sender, X509Certificate remoteCertificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { // このシンプルなデモでは、すべてのサーバー証明書を受け入れます。 return true; }
Private Sub explicitLogin() ftp1.Session.RemoteEndPoint.HostNameOrAddress = myServer ftp1.Session.Username = myUsername ftp1.Session.Password = myPassword ftp1.Session.Security.EncryptControl = EncryptControl.Explicit ftp1.Session.Security.EncryptData = True ftp1.Session.Security.ValidationCallback = AddressOf remoteCertificateValidation ftp1.Connect() ftp1.Authenticate() ftp1.List("", "", ListType.Full) ftp1.Close() End Sub Private Function remoteCertificateValidation(ByVal sender As Object, ByVal remoteCertificate As X509Certificate, _ ByVal chain As X509Chain, ByVal sslPolicyErrors As SslPolicyErrors) As Boolean ' このシンプルなデモでは、すべてのサーバー証明書を受け入れます。 Return True End Function