Using favorites in the SFTP lib

This forum is not monitored by the SmartFTP staff. If you have a license please contact technical support by email.
D0JpgDlc
Posts: 10
Joined: Tue May 19, 2009 3:45 pm

Using favorites in the SFTP lib

Post by D0JpgDlc » Tue May 19, 2009 3:50 pm

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?

mb
Posts: 12026
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: Using favorites in the SFTP lib

Post by mb » Tue May 19, 2009 4:47 pm

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.

Regards,
Mat

D0JpgDlc
Posts: 10
Joined: Tue May 19, 2009 3:45 pm

Re: Using favorites in the SFTP lib

Post by D0JpgDlc » Tue May 19, 2009 5:05 pm

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

mb
Posts: 12026
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: Using favorites in the SFTP lib

Post by mb » Tue May 19, 2009 5:14 pm

In VBScript it looks like this:

Code: Select all

Dim objFavoriteItem

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

objFavoriteItem.LoadXML(strFile)

WScript.Echo objFavoriteItem.Username

WScript.Echo objFavoriteItem.Password

D0JpgDlc
Posts: 10
Joined: Tue May 19, 2009 3:45 pm

Re: Using favorites in the SFTP lib

Post by D0JpgDlc » Tue May 19, 2009 5:29 pm

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

mb
Posts: 12026
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: Using favorites in the SFTP lib

Post by mb » Tue May 19, 2009 5:32 pm

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.

Regard,s
Mat

D0JpgDlc
Posts: 10
Joined: Tue May 19, 2009 3:45 pm

Re: Using favorites in the SFTP lib

Post by D0JpgDlc » Tue May 19, 2009 5:37 pm

Thanks

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?

mb
Posts: 12026
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: Using favorites in the SFTP lib

Post by mb » Tue May 19, 2009 5:41 pm

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.

Regards,
Mat

D0JpgDlc
Posts: 10
Joined: Tue May 19, 2009 3:45 pm

Re: Using favorites in the SFTP lib

Post by D0JpgDlc » Tue May 19, 2009 5:49 pm

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.

mb
Posts: 12026
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: Using favorites in the SFTP lib

Post by mb » Tue May 19, 2009 6:07 pm

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.

Regards,
Mat

Post Reply