port from vb6 to c# - WeOnlyDo Discussion board

port from vb6 to c# (wodFtpDLX / wodFtpDLX.NET)

by Rien van Ham, Thursday, December 10, 2015, 19:30 (3271 days ago)

Dear all,

I'm quite new to c# and I'm trying to port a very old application from vb6 to c#. Off course all new code is build from the ground up (based on the vb-code).

I'm getting stuck with a piece of code to connect a certificate to the sftp-object.

Some code:

if (moFTP.State == wodFtpDLXComLib.StatesEnum.Connected) { moFTP.Disconnect(); }
moFTP.Hostname = Bron.IpAdres;
moFTP.ProxyHostname = "";
moFTP.ProxyPort = 1080;
moFTP.ProxyType = 0;
moFTP.Timeout = 600;
moFTP.Passive = false;
moFTP.TransferMode = 0;
moFTP.Compression = 6;
moFTP.Blocking = true;
moFTP.Login = "";
moFTP.Password = "";

WODCERTMNGLib.Certificate certificaat = new WODCERTMNGLib.Certificate();
certificaat.LoadKey(certificatenDirectory + Bron.Certificaat);
moFTP.Certificate = certificaat; <<----- ERROR!!


Error:
Cannot implicity convert type WODCERTMNGLib.Certificate to WodFtpDlxComLib.ICertificate.....


What do I have to do?

Thanks in advance!

Rien.


Complete thread: