Compartir a través de


ICredentialBuilder.SpecifyCredentials Método

Definición

Muestra un cuadro de diálogo para recopilar información de credenciales.

Sobrecargas

SpecifyCredentials(IServiceProvider, String, String, String, Boolean, Boolean, String, String, String)

Muestra un cuadro de diálogo para recopilar información de credenciales.

SpecifyCredentials(IServiceProvider, String, String, String, Boolean, Boolean, String, String, String, EventHandler<CredentialInfoEventArgs>)

Muestra un cuadro de diálogo para recopilar información de credenciales mediante el delegado de controlador de eventos especificado para guardar los cambios.

SpecifyCredentials(IServiceProvider, String, String, String, Boolean, Boolean, String, String, String, EventHandler<CredentialInfoEventArgs>, EventHandler)

Muestra un cuadro de diálogo para recopilar información de credenciales mediante los delegados del controlador de eventos especificados para guardar los cambios y mostrar la Ayuda.

SpecifyCredentials(IServiceProvider, String, String, String, Boolean, Boolean, String, String, String, EventHandler<CredentialInfoEventArgs>, EventHandler, Boolean)

Muestra un cuadro de diálogo para recopilar información de credenciales, utilizando los delegados de controlador de eventos especificados para guardar los cambios y mostrar ayuda y el parámetro de solo lectura especificado para el texto del cuadro de diálogo.

SpecifyCredentials(IServiceProvider, String, String, String, Boolean, Boolean, String, String, String)

Muestra un cuadro de diálogo para recopilar información de credenciales.

public:
 Microsoft::Web::Management::Client::CredentialInfo ^ SpecifyCredentials(IServiceProvider ^ serviceProvider, System::String ^ dialogTitleText, System::String ^ userName, System::String ^ password, bool isModify, bool verifyValidWindowsUserPassword, System::String ^ description, System::String ^ setSpecificCredentialsText, System::String ^ otherOptionText);
public Microsoft.Web.Management.Client.CredentialInfo SpecifyCredentials (IServiceProvider serviceProvider, string dialogTitleText, string userName, string password, bool isModify, bool verifyValidWindowsUserPassword, string description, string setSpecificCredentialsText, string otherOptionText);
abstract member SpecifyCredentials : IServiceProvider * string * string * string * bool * bool * string * string * string -> Microsoft.Web.Management.Client.CredentialInfo
Public Function SpecifyCredentials (serviceProvider As IServiceProvider, dialogTitleText As String, userName As String, password As String, isModify As Boolean, verifyValidWindowsUserPassword As Boolean, description As String, setSpecificCredentialsText As String, otherOptionText As String) As CredentialInfo

Parámetros

serviceProvider
IServiceProvider

Interfaz IServiceProvider que representa al proveedor de servicios para recopilar credenciales de usuario.

dialogTitleText
String

Título del cuadro de diálogo.

userName
String

Nombre de usuario.

password
String

Contraseña del usuario.

isModify
Boolean

Este parámetro se reserva para uso futuro.

verifyValidWindowsUserPassword
Boolean

true si se debe comprobar la contraseña para Windows; de lo contrario, false.

description
String

Descripción del usuario.

setSpecificCredentialsText
String

Usuario específico.

otherOptionText
String

El usuario alternativo.

Devoluciones

Objeto CredentialInfo que se crea con los parámetros de esta sobrecarga.

Ejemplos

En el ejemplo siguiente se implementa este método.

public CredentialInfo SetCredentials(IServiceProvider serviceProvider,
bool verifyPW) {
    return this.SetCredentials(serviceProvider,
        verifyPW, null);
}

public CredentialInfo SetCredentials(IServiceProvider serviceProvider,
    bool verifyPW, EventHandler showHelp) {
    if (serviceProvider == null) {
        throw new ArgumentNullException("serviceProvider");
    }

    IManagementUIService uiService = (IManagementUIService)serviceProvider.
        GetService(typeof(IManagementUIService));
    Debug.Assert(uiService != null);

    CredentialInfo credentials = null;

    using (SetCredoDlg dialog =
        new SetCredoDlg(serviceProvider, showHelp)) {
        dialog.VerifyValidWindowsUserPassword = verifyPW;

        if (uiService.ShowDialog(dialog) == DialogResult.OK) {
            credentials = new CredentialInfo();
            credentials.UserName = dialog.UserName;
            credentials.Password = dialog.Password;
        }
    }

    return credentials;
} 

Comentarios

Si el userName parámetro es o está null vacío, IIS usa la autenticación de paso a través.

Se aplica a

SpecifyCredentials(IServiceProvider, String, String, String, Boolean, Boolean, String, String, String, EventHandler<CredentialInfoEventArgs>)

Muestra un cuadro de diálogo para recopilar información de credenciales mediante el delegado de controlador de eventos especificado para guardar los cambios.

public:
 Microsoft::Web::Management::Client::CredentialInfo ^ SpecifyCredentials(IServiceProvider ^ serviceProvider, System::String ^ dialogTitleText, System::String ^ userName, System::String ^ password, bool isModify, bool verifyValidWindowsUserPassword, System::String ^ description, System::String ^ setSpecificCredentialsText, System::String ^ otherOptionText, EventHandler<Microsoft::Web::Management::Client::CredentialInfoEventArgs ^> ^ commitHandler);
public Microsoft.Web.Management.Client.CredentialInfo SpecifyCredentials (IServiceProvider serviceProvider, string dialogTitleText, string userName, string password, bool isModify, bool verifyValidWindowsUserPassword, string description, string setSpecificCredentialsText, string otherOptionText, EventHandler<Microsoft.Web.Management.Client.CredentialInfoEventArgs> commitHandler);
abstract member SpecifyCredentials : IServiceProvider * string * string * string * bool * bool * string * string * string * EventHandler<Microsoft.Web.Management.Client.CredentialInfoEventArgs> -> Microsoft.Web.Management.Client.CredentialInfo
Public Function SpecifyCredentials (serviceProvider As IServiceProvider, dialogTitleText As String, userName As String, password As String, isModify As Boolean, verifyValidWindowsUserPassword As Boolean, description As String, setSpecificCredentialsText As String, otherOptionText As String, commitHandler As EventHandler(Of CredentialInfoEventArgs)) As CredentialInfo

Parámetros

serviceProvider
IServiceProvider

Interfaz IServiceProvider que representa el proveedor de servicios para recopilar credenciales de usuario.

dialogTitleText
String

Título del cuadro de diálogo.

userName
String

Nombre de usuario.

password
String

Contraseña del usuario.

isModify
Boolean

Este parámetro se reserva para uso futuro.

verifyValidWindowsUserPassword
Boolean

true si se debe comprobar la contraseña para Windows; de lo contrario, false.

description
String

Descripción del usuario.

setSpecificCredentialsText
String

Usuario específico.

otherOptionText
String

El usuario alternativo.

commitHandler
EventHandler<CredentialInfoEventArgs>

Delegado del controlador de eventos que se usa para guardar los cambios.

Devoluciones

Objeto CredentialInfo que se crea con los parámetros de esta sobrecarga.

Ejemplos

En el ejemplo siguiente se implementa este método.

public CredentialInfo SetCredentials(IServiceProvider serviceProvider,
bool verifyPW) {
    return this.SetCredentials(serviceProvider,
        verifyPW, null);
}

public CredentialInfo SetCredentials(IServiceProvider serviceProvider,
    bool verifyPW, EventHandler showHelp) {
    if (serviceProvider == null) {
        throw new ArgumentNullException("serviceProvider");
    }

    IManagementUIService uiService = (IManagementUIService)serviceProvider.
        GetService(typeof(IManagementUIService));
    Debug.Assert(uiService != null);

    CredentialInfo credentials = null;

    using (SetCredoDlg dialog =
        new SetCredoDlg(serviceProvider, showHelp)) {
        dialog.VerifyValidWindowsUserPassword = verifyPW;

        if (uiService.ShowDialog(dialog) == DialogResult.OK) {
            credentials = new CredentialInfo();
            credentials.UserName = dialog.UserName;
            credentials.Password = dialog.Password;
        }
    }

    return credentials;
} 

Comentarios

Si el userName parámetro es o está null vacío, IIS usa la autenticación de paso a través.

Se aplica a

SpecifyCredentials(IServiceProvider, String, String, String, Boolean, Boolean, String, String, String, EventHandler<CredentialInfoEventArgs>, EventHandler)

Muestra un cuadro de diálogo para recopilar información de credenciales mediante los delegados del controlador de eventos especificados para guardar los cambios y mostrar la Ayuda.

public:
 Microsoft::Web::Management::Client::CredentialInfo ^ SpecifyCredentials(IServiceProvider ^ serviceProvider, System::String ^ dialogTitleText, System::String ^ userName, System::String ^ password, bool isModify, bool verifyValidWindowsUserPassword, System::String ^ description, System::String ^ setSpecificCredentialsText, System::String ^ otherOptionText, EventHandler<Microsoft::Web::Management::Client::CredentialInfoEventArgs ^> ^ commitHandler, EventHandler ^ showHelp);
public Microsoft.Web.Management.Client.CredentialInfo SpecifyCredentials (IServiceProvider serviceProvider, string dialogTitleText, string userName, string password, bool isModify, bool verifyValidWindowsUserPassword, string description, string setSpecificCredentialsText, string otherOptionText, EventHandler<Microsoft.Web.Management.Client.CredentialInfoEventArgs> commitHandler, EventHandler showHelp);
abstract member SpecifyCredentials : IServiceProvider * string * string * string * bool * bool * string * string * string * EventHandler<Microsoft.Web.Management.Client.CredentialInfoEventArgs> * EventHandler -> Microsoft.Web.Management.Client.CredentialInfo
Public Function SpecifyCredentials (serviceProvider As IServiceProvider, dialogTitleText As String, userName As String, password As String, isModify As Boolean, verifyValidWindowsUserPassword As Boolean, description As String, setSpecificCredentialsText As String, otherOptionText As String, commitHandler As EventHandler(Of CredentialInfoEventArgs), showHelp As EventHandler) As CredentialInfo

Parámetros

serviceProvider
IServiceProvider

Interfaz IServiceProvider que representa el proveedor de servicios para recopilar credenciales de usuario.

dialogTitleText
String

Título del cuadro de diálogo.

userName
String

Nombre de usuario.

password
String

Contraseña del usuario.

isModify
Boolean

Este parámetro se reserva para uso futuro.

verifyValidWindowsUserPassword
Boolean

true si se debe comprobar la contraseña para Windows; de lo contrario, false.

description
String

Descripción del usuario.

setSpecificCredentialsText
String

Usuario específico.

otherOptionText
String

El usuario alternativo.

commitHandler
EventHandler<CredentialInfoEventArgs>

Delegado del controlador de eventos que se usa para guardar los cambios.

showHelp
EventHandler

Delegado del controlador de eventos que se usa para mostrar la Ayuda.

Devoluciones

Objeto CredentialInfo que se crea con los parámetros de esta sobrecarga.

Ejemplos

En el ejemplo siguiente se implementa este método.

public CredentialInfo SetCredentials(IServiceProvider serviceProvider,
bool verifyPW) {
    return this.SetCredentials(serviceProvider,
        verifyPW, null);
}

public CredentialInfo SetCredentials(IServiceProvider serviceProvider,
    bool verifyPW, EventHandler showHelp) {
    if (serviceProvider == null) {
        throw new ArgumentNullException("serviceProvider");
    }

    IManagementUIService uiService = (IManagementUIService)serviceProvider.
        GetService(typeof(IManagementUIService));
    Debug.Assert(uiService != null);

    CredentialInfo credentials = null;

    using (SetCredoDlg dialog =
        new SetCredoDlg(serviceProvider, showHelp)) {
        dialog.VerifyValidWindowsUserPassword = verifyPW;

        if (uiService.ShowDialog(dialog) == DialogResult.OK) {
            credentials = new CredentialInfo();
            credentials.UserName = dialog.UserName;
            credentials.Password = dialog.Password;
        }
    }

    return credentials;
} 

Comentarios

Si el userName parámetro es o está null vacío, IIS usa la autenticación de paso a través.

Se aplica a

SpecifyCredentials(IServiceProvider, String, String, String, Boolean, Boolean, String, String, String, EventHandler<CredentialInfoEventArgs>, EventHandler, Boolean)

Muestra un cuadro de diálogo para recopilar información de credenciales, utilizando los delegados de controlador de eventos especificados para guardar los cambios y mostrar ayuda y el parámetro de solo lectura especificado para el texto del cuadro de diálogo.

public:
 Microsoft::Web::Management::Client::CredentialInfo ^ SpecifyCredentials(IServiceProvider ^ serviceProvider, System::String ^ dialogTitleText, System::String ^ userName, System::String ^ password, bool isModify, bool verifyValidWindowsUserPassword, System::String ^ description, System::String ^ setSpecificCredentialsText, System::String ^ otherOptionText, EventHandler<Microsoft::Web::Management::Client::CredentialInfoEventArgs ^> ^ commitHandler, EventHandler ^ showHelp, bool readOnly);
public Microsoft.Web.Management.Client.CredentialInfo SpecifyCredentials (IServiceProvider serviceProvider, string dialogTitleText, string userName, string password, bool isModify, bool verifyValidWindowsUserPassword, string description, string setSpecificCredentialsText, string otherOptionText, EventHandler<Microsoft.Web.Management.Client.CredentialInfoEventArgs> commitHandler, EventHandler showHelp, bool readOnly);
abstract member SpecifyCredentials : IServiceProvider * string * string * string * bool * bool * string * string * string * EventHandler<Microsoft.Web.Management.Client.CredentialInfoEventArgs> * EventHandler * bool -> Microsoft.Web.Management.Client.CredentialInfo
Public Function SpecifyCredentials (serviceProvider As IServiceProvider, dialogTitleText As String, userName As String, password As String, isModify As Boolean, verifyValidWindowsUserPassword As Boolean, description As String, setSpecificCredentialsText As String, otherOptionText As String, commitHandler As EventHandler(Of CredentialInfoEventArgs), showHelp As EventHandler, readOnly As Boolean) As CredentialInfo

Parámetros

serviceProvider
IServiceProvider

Interfaz IServiceProvider que representa el proveedor de servicios para recopilar credenciales de usuario.

dialogTitleText
String

Título del cuadro de diálogo.

userName
String

Nombre de usuario.

password
String

Contraseña del usuario.

isModify
Boolean

Este parámetro se reserva para uso futuro.

verifyValidWindowsUserPassword
Boolean

true si se debe comprobar la contraseña para Windows; de lo contrario, false.

description
String

Descripción del usuario.

setSpecificCredentialsText
String

Usuario específico.

otherOptionText
String

El usuario alternativo.

commitHandler
EventHandler<CredentialInfoEventArgs>

Delegado del controlador de eventos que se usa para guardar los cambios.

showHelp
EventHandler

Delegado del controlador de eventos que se usa para mostrar la Ayuda.

readOnly
Boolean

true si los cuadros de texto del cuadro de diálogo son de solo lectura; false si los cuadros de texto son de lectura y escritura.

Devoluciones

Objeto CredentialInfo que se crea con los parámetros de esta sobrecarga.

Ejemplos

En el ejemplo siguiente se implementa este método.

public CredentialInfo SetCredentials(IServiceProvider serviceProvider,
bool verifyPW) {
    return this.SetCredentials(serviceProvider,
        verifyPW, null);
}

public CredentialInfo SetCredentials(IServiceProvider serviceProvider,
    bool verifyPW, EventHandler showHelp) {
    if (serviceProvider == null) {
        throw new ArgumentNullException("serviceProvider");
    }

    IManagementUIService uiService = (IManagementUIService)serviceProvider.
        GetService(typeof(IManagementUIService));
    Debug.Assert(uiService != null);

    CredentialInfo credentials = null;

    using (SetCredoDlg dialog =
        new SetCredoDlg(serviceProvider, showHelp)) {
        dialog.VerifyValidWindowsUserPassword = verifyPW;

        if (uiService.ShowDialog(dialog) == DialogResult.OK) {
            credentials = new CredentialInfo();
            credentials.UserName = dialog.UserName;
            credentials.Password = dialog.Password;
        }
    }

    return credentials;
} 

Comentarios

Si el userName parámetro es o está null vacío, IIS usa la autenticación de paso a través. Si el readOnly parámetro es false, los usuarios pueden cambiar el texto de los cuadros de texto.

Se aplica a