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

AF SDK Reference

AFPromptForCredential.ShowDialog Method (IWin32Window, PISystem, Boolean)

AFPromptForCredential.ShowDialog Method (IWin32Window, PISystem, Boolean)

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFPromptForCredential.ShowDialog Method (IWin32Window, PISystem, Boolean)
Show the prompt for credential dialog to get a NetworkCredential to connect to a PISystem.

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

Syntax

public static NetworkCredential ShowDialog(
	IWin32Window owner,
	PISystem system,
	bool failMessage = false
)
Public Shared Function ShowDialog ( 
	owner As IWin32Window,
	system As PISystem,
	Optional failMessage As Boolean = false
) As NetworkCredential

Dim owner As IWin32Window
Dim system As PISystem
Dim failMessage As Boolean
Dim returnValue As NetworkCredential

returnValue = AFPromptForCredential.ShowDialog(owner, 
	system, failMessage)
public:
static NetworkCredential^ ShowDialog(
	IWin32Window^ owner, 
	PISystem^ system, 
	bool failMessage = false
)
static member ShowDialog : 
        owner : IWin32Window * 
        system : PISystem * 
        ?failMessage : bool 
(* Defaults:
        let _failMessage = defaultArg failMessage false
*)
-> NetworkCredential 

Parameters

owner
Type: System.Windows.FormsIWin32Window
The owner window for the dialog box.
system
Type: OSIsoft.AFPISystem
The PISystem for the requested login credential.
failMessage (Optional)
Type: SystemBoolean
If , the description in the dialog will indicate that a failed login attempt has occurred.

Return Value

Type: NetworkCredential
Returns if the dialog was canceled. Otherwise, a NetworkCredential is returned based upon the information provided in the dialog.

Remarks

This method is used to show a dialog to prompt for user credentials to be used when connecting to a PISystem. If the RememberCredential property is after the dialog is closed, then the credentials will be saved to the Windows Credential Manager using the SaveCredential(String, String, SecureString) method.

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
Related Links
TitleResults for “How to create a CRG?”Also Available in