Using favorites in the SFTP lib

I was looking to use the SDK to do some SFTP processing. I would like to get the userid and password from the favorites in SmartFTP. Is this possible? I do not want to code the user id and password of the sites in my programs or store them in a file. I know that SmartFTP does some basic encrypting of the password it stores so I would want to take advantage of that. Is it possible?

Hello ..

Yes. Create a sfFavorites::FavoriteItem object. Then use the Load method to load the favorite XML file. Then you can access the plaintext password in the Password property of the IFavoriteItem object.

If you need further info please let me know.


Thanks for the qucik response. I plan onusing VB. Are you talking about a class? I'm afraid I don't see what you mention

In VBScript it looks like this:

Dim objFavoriteItem

Set objFavoriteItem = WScript.CreateObject("sfFavorites.FavoriteItem")


WScript.Echo objFavoriteItem.Username

WScript.Echo objFavoriteItem.Password

I am using VB6 not VBScript. Is there a sample for that? I don't see a class with this stuff in it. Is there only one dll that gets installed? C:\program files\smartftp ftplibrary\sfFTPLib.dll I added as a reference to my project and can't find the favorites

No there is no sample for VB6. VBScript and VB6 are almost identical. You have to add the sfFavorites.dll as a reference as well.



That is what is missing. I don't have that dll. I downloaded the library and installed but there is no sfFavorite.dll anywhere on the computer. Where would I get that?

It's in the SmartFTP application folder: %ProgramFiles%\SmartFTP Client

An note regarding licensing. You are not allowed to distribute the sfFavorites.dll file. It can only used if the computer/person using your application has SmartFTP installed. But if you have no intention to sell/deploy your application to other persons/computers it does not apply.


That explains it. The machine I am trying to test my theory doesn't have SmartFTP installed on it no wonder I couldn't find the dll. The machine I hope to deploy my application on does have smartFTP on it so according to your post I don't have a licensing issue? I will download an evaluation copy of smartFTP to my development machine to test my theory. Thanks for the quick response.

If you use the SmartFTP SDK (sfFavorites.dll, sfTransferQueue.dll, etc) you need to have a license for the Profession edition for each computer/user using the SDK.


What value is passed to the LoadXML method? I've tried using the favorites identifier, and the name of the xml file on the computer.

Public objFavoriteItem As New sfFavorites.FavoriteItem

Private Sub cmdDoIt_Click()
Dim Worked As Boolean
Worked = objFavoriteItem.LoadXML("{4F77B06B-DD93-4821-82AB-0BDB8F823149}.xml")
txtUserName.Text = objFavoriteItem.Username
txtPassword.Text = objFavoriteItem.Password
End Sub

Pass the complete path to the .xml file.

That was it. Is there a help file or document for the favorites dll? I think it will do what I need it to do but it would be nice to have a document to reference. Ideally I'd like to identify the favorite by its name. For my proof of concept hardcoding the path name will do.

Hello ..

The SDK is provided as it is. We can also provide very limited technical support.


That is a shame. The dll's for favorites and the transfer queue look they are very loaded with features but without a manual I am not sure I want to try out my idea. Although you have been very responsive to every post I don't think I can count on that while trying to develop a full blown solution.