Implementing FTP and SFTP in one application

Hi everybody,

I have a question according to ftp/sftp with SmartFTP-Library.
I'd like to create an VB6 application which can do file transfer via ftp and sftp. This should be controlled via a flag in an ini file.

My question is, what is the best way to do that?
I have already implemented FTP, but now, when I try to use SFTP I have some problems with missing methods or also same function name but different parameters.

ChangeDirectory doensn't exist with SFTP
ftp UploadFile has differnt parameters than sftp UploadFile

I'd like to use the same object and just at time of creation I'd like to decide what I have to create, like this:

If SFTP Then
Set objFTP = CreateObject("sfFTPLib.SFTPConnection")
Set objFTP = CreateObject("sfFTPLib.FTPConnectionSTA")
End If

It would be possible to define 2 different objects, but than I would have to use different ways for e.g. up-/downloading a file??
Or is there a better way to do that?

Thanks in advance!

Bye, Markus

You have to make 2 implementations. One for FTP and one for SFTP. The best way is to introduce a new abstraction layer. E.g. create an abstract base class Connection and then implement two concrete classes FTPConnection ans SFTPConnection. However I do not know what OOP features VB6 offers. I strongly recommend to use VB.NET or C# if you have the choice.