Difference between revisions of "KeychainItem.ServiceName"

From Xojo Documentation

(SMBot: new page by automated transformation)
 
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{PropertyBox
 
{{PropertyBox
 
| name=ServiceName
 
| name=ServiceName
| owner=[[KeyChainItem]]
+
| owner=[[KeychainItem]]
 
| ownertype=class
 
| ownertype=class
 
| scope=public
 
| scope=public
 
| type=[[String]]
 
| type=[[String]]
| platform=all
+
| platform=mac
 
}}
 
}}
Contains the name of the service (required for adding, can be [[Nil]] to find).  
+
{{Description
 +
|text = Contains the name of the service (required for adding, can be [[Nil]] to find). To add a password for an application, set ServiceName to the application’s name. }}
  
To add a password for an application, set ServiceName to the application's name.
+
==Example==
 +
 
 +
This example set the text of a [[TextField]] to the description of a '''KeychainItem'''.
 +
 
 +
<rbcode>
 +
Var kc As Keychain
 +
Var kci As KeychainItem
 +
 
 +
kc = New Keychain(Listbox1.SelectedIndex)
 +
 
 +
If kc <> Nil Then
 +
  kci = New KeychainItem
 +
  kci.ServiceName = SearchField.Value
 +
 
 +
  PasswordField.Value = kc.FindPassword(kci)
 +
 
 +
  ServiceNameField.Value = kci.ServiceName
 +
  AccountNameField.Value = kci.AccountName
 +
  CommentField.Value = kci.Comment
 +
  LabelField.Value = kci.Label
 +
End If
 +
</rbcode>

Latest revision as of 23:51, 30 July 2019

Property (As String )


aKeychainItem.ServiceName = newStringValue
or
StringValue = aKeychainItem.ServiceName

Supported for all project types and targets.

Contains the name of the service (required for adding, can be Nil to find). To add a password for an application, set ServiceName to the application’s name.

Example

This example set the text of a TextField to the description of a KeychainItem.

Var kc As Keychain
Var kci As KeychainItem

kc = New Keychain(Listbox1.SelectedIndex)

If kc <> Nil Then
kci = New KeychainItem
kci.ServiceName = SearchField.Value

PasswordField.Value = kc.FindPassword(kci)

ServiceNameField.Value = kci.ServiceName
AccountNameField.Value = kci.AccountName
CommentField.Value = kci.Comment
LabelField.Value = kci.Label
End If