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

AF SDK Reference

Product Family
Current publication

AFPromptForCredential.ShowDialog Method (IWin32Window, PICollectiveMember, PIAuthenticationMode, Boolean, Boolean, Boolean)

Table of Contents
HomeAF SDK Reference...NamespacesOSIsoft.AF.UIAFPromptForCredential ClassAFPromptForCredential MethodsShowDialog Method AFPromptForCredential.ShowDialog Method (IWin32Window, PICollectiveMember, PIAuthenticationMode, Boolean, Boolean, Boolean)Current page
TABLE OF CONTENTS

AFPromptForCredential.ShowDialog Method (IWin32Window, PICollectiveMember, PIAuthenticationMode, Boolean, Boolean, Boolean)

AFPromptForCredential.ShowDialog Method (IWin32Window, PICollectiveMember, PIAuthenticationMode, Boolean, Boolean, Boolean)
Show the prompt for credential dialog to get a NetworkCredential to connect to a PIServer.

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

Syntax

public static NetworkCredential ShowDialog(
	IWin32Window owner,
	PICollectiveMember member,
	ref PIAuthenticationMode authenticationMode,
	bool allowPIUser = true,
	bool allowWinUser = true,
	bool failMessage = false
)
Public Shared Function ShowDialog ( 
	owner As IWin32Window,
	member As PICollectiveMember,
	ByRef authenticationMode As PIAuthenticationMode,
	Optional allowPIUser As Boolean = true,
	Optional allowWinUser As Boolean = true,
	Optional failMessage As Boolean = false
) As NetworkCredential

Dim owner As IWin32Window
Dim member As PICollectiveMember
Dim authenticationMode As PIAuthenticationMode
Dim allowPIUser As Boolean
Dim allowWinUser As Boolean
Dim failMessage As Boolean
Dim returnValue As NetworkCredential

returnValue = AFPromptForCredential.ShowDialog(owner, 
	member, authenticationMode, allowPIUser, 
	allowWinUser, failMessage)
public:
static NetworkCredential^ ShowDialog(
	IWin32Window^ owner, 
	PICollectiveMember^ member, 
	PIAuthenticationMode% authenticationMode, 
	bool allowPIUser = true, 
	bool allowWinUser = true, 
	bool failMessage = false
)
static member ShowDialog : 
        owner : IWin32Window * 
        member : PICollectiveMember * 
        authenticationMode : PIAuthenticationMode byref * 
        ?allowPIUser : bool * 
        ?allowWinUser : bool * 
        ?failMessage : bool 
(* Defaults:
        let _allowPIUser = defaultArg allowPIUser true
        let _allowWinUser = defaultArg allowWinUser true
        let _failMessage = defaultArg failMessage false
*)
-> NetworkCredential 

Parameters

owner
Type: System.Windows.Forms.IWin32Window
The owner window for the dialog box.
member
Type: OSIsoft.AF.PI.PICollectiveMember
The PICollectiveMember for the requested login credential.
authenticationMode
Type: OSIsoft.AF.PI.PIAuthenticationMode
The initial selection for the authentication mode in the dialog. Upon return, it is updated with the value selected in the dialog.
allowPIUser (Optional)
Type: System.Boolean
If true, then the PIUserAuthentication is allowed as an authentication mode.
allowWinUser (Optional)
Type: System.Boolean
If true, then the WindowsAuthentication is allowed as an authentication mode.
failMessage (Optional)
Type: System.Boolean
If true, the description in the dialog will indicate that a failed login attempt has occurred.

Return Value

Type: NetworkCredential
Returns null 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 PIServer. If the RememberCredential property is true 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.0, 3.0.2, 3.0.1, 3.0.0

See Also

Was this topic helpful?