Dart.Ftp 名前空間 : FtpSecurity クラス |
<TypeConverterAttribute("System.ComponentModel.ExpandableObjectConverter, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")> <SerializableAttribute()> Public Class FtpSecurity Inherits ClientSecurity
[TypeConverter("System.ComponentModel.ExpandableObjectConverter, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] [Serializable()] public class FtpSecurity : ClientSecurity
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
System.Object
Dart.Ftp.Security
Dart.Ftp.ClientSecurity
Dart.Ftp.FtpSecurity