realbasic-nug
[Top] [All Lists]

Keychain code not working.

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Keychain code not working.
From: Duane Hennessy <duaneh at connexus dot net dot au>
Date: Fri, 31 Dec 2004 21:16:27 +1000
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Organization: Bandicoot Software
Xantivirus: This e-mail has been scanned for viruses via the Connexus Internet Service
I grabbed the example code from the RB Help to add a password to the keychain when the user adds one to my app. The code is as follows...

-----
 dim kci As KeyChainItem

   // create new password
   UserPassword=NewPassword.Text
If System.KeyChainCount > 0 then
         kci = New KeyChainItem

         'Indicate the name of the application
         kci.ServiceName = "ApplicationName"
         kci.AccountName="ApplicationName"
         kci.Description="Password to access encrypted files."
'Create a new keychain item for the application and assign the password
         System.KeyChain.AddPassword kci, UserPassword
       Else
         Beep
         MsgBox "You do not have a key chain."
       End if
-----

All I get is no password added and an error number of Zero, which I thought meant there was no error?! :-/

Anyone know what the issue might be or whether it would be better for me to create AppleScript to do the job and compile that into my application instead?

TIA :-)

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
<Prev in Thread] Current Thread [Next in Thread>
  • Keychain code not working., Duane Hennessy <=