Ftp Object : Certificate Property |
Visual Basic |
---|
Public Property Certificate As Certificate |
When Protocol is secureNone:
On the server side, always set this property before enabling the server.
On the client side, this property is typically unused. If the server wants the client to authenticate and this property has not been set, then the Certificate event fires to allow you to set a certificate on demand.
Dim Store As New CertificateStore Dim Certificate As Certificate 'Get the certificates in "MY" certificate store located in the 'Local Machine registry key. Store.Name = "MY" Store.Location = locationLocalMachine 'Must use Refresh to populate Store.Certificates Store.Refresh MsgBox "There are " & Store.Certificates.Count & " certificates." 'Set the certificate to the one for "DartServer" For Each Certificate In Store.Certificates If Certificate.IssuedTo = "DartServer" Then Ftp1.Certificate = Certificate Exit For End If Next
Dim Store As New CertificateStore 'Get the desired certificate Ftp1.Certificate = Store.Find("ROOT", locationLocalMachine, g_SavedIssuedBy, g_SavedSerialNumber)