Jump to content


Photo

Using favorites in the SFTP lib


  • Please log in to reply
14 replies to this topic

#1 D0JpgDlc

D0JpgDlc
  • Members
  • 10 posts

Posted 19 May 2009 - 03: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?

#2 mb

mb

    Developer

  • Administrators
  • 11520 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 19 May 2009 - 04: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

#3 D0JpgDlc

D0JpgDlc
  • Members
  • 10 posts

Posted 19 May 2009 - 05: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

#4 mb

mb

    Developer

  • Administrators
  • 11520 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 19 May 2009 - 05:14 PM

In VBScript it looks like this:

Dim objFavoriteItem
Set objFavoriteItem = WScript.CreateObject("sfFavorites.FavoriteItem")
objFavoriteItem.LoadXML(strFile)
WScript.Echo objFavoriteItem.Username
WScript.Echo objFavoriteItem.Password


#5 D0JpgDlc

D0JpgDlc
  • Members
  • 10 posts

Posted 19 May 2009 - 05: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

#6 mb

mb

    Developer

  • Administrators
  • 11520 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 19 May 2009 - 05: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

#7 D0JpgDlc

D0JpgDlc
  • Members
  • 10 posts

Posted 19 May 2009 - 05: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?

#8 mb

mb

    Developer

  • Administrators
  • 11520 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 19 May 2009 - 05: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

#9 D0JpgDlc

D0JpgDlc
  • Members
  • 10 posts

Posted 19 May 2009 - 05: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.

#10 mb

mb

    Developer

  • Administrators
  • 11520 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 19 May 2009 - 06: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

#11 D0JpgDlc

D0JpgDlc
  • Members
  • 10 posts

Posted 20 May 2009 - 07:17 PM

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

#12 mb

mb

    Developer

  • Administrators
  • 11520 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 20 May 2009 - 07:22 PM

Pass the complete path to the .xml file.

#13 D0JpgDlc

D0JpgDlc
  • Members
  • 10 posts

Posted 20 May 2009 - 07:40 PM

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.

#14 mb

mb

    Developer

  • Administrators
  • 11520 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 20 May 2009 - 07:52 PM

Hello ..

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

Sorry.
Regards,
Mat

#15 D0JpgDlc

D0JpgDlc
  • Members
  • 10 posts

Posted 20 May 2009 - 08:06 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users