Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFPromptForCredential.SaveCredential Method

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFPromptForCredential.SaveCredential Method
Save a credential into the Windows Credential Manager.

Namespace:  OSIsoft.AF.UI
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public static void SaveCredential(
	string target,
	string userName,
	SecureString password
)
Public Shared Sub SaveCredential ( 
	target As String,
	userName As String,
	password As SecureString
)

Dim target As String
Dim userName As String
Dim password As SecureString

AFPromptForCredential.SaveCredential(target, userName, 
	password)
public:
static void SaveCredential(
	String^ target, 
	String^ userName, 
	SecureString^ password
)
static member SaveCredential : 
        target : string * 
        userName : string * 
        password : SecureString -> unit 

Parameters

target
Type: SystemString
The target for the credential in the Windows Credential Manager.
userName
Type: SystemString
The user name for the credential to be saved in the Windows Credential Manager.
password
Type: System.SecuritySecureString
The password for the credential to be saved in the Windows Credential Manager.

Remarks

This method is used to save a credential into the Windows Credential Manager for the specified target. If a credential is already present for the target, it is overwritten. This method is automatically called when using one of the ShowDialog Overload methods and the RememberCredential property is after the dialog is closed.

If not using one of the ShowDialog Overload methods, then this method should be called to save the credential to the Windows Credential Manger.

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7

See Also

In This Topic
TitleResults for “How to create a CRG?”Also Available in