Compartilhar via


ICredentialBuilder.SpecifyCredentials Método

Definição

Exibe uma caixa de diálogo para coletar informações de credencial.

Sobrecargas

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

Exibe uma caixa de diálogo para coletar informações de credencial.

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

Exibe uma caixa de diálogo para coletar informações de credencial, usando o delegado de manipulador de eventos especificado para salvar alterações.

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

Exibe uma caixa de diálogo para coletar informações de credencial, usando os delegados do manipulador de eventos especificados para salvar alterações e exibir a Ajuda.

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

Exibe uma caixa de diálogo para coletar informações de credencial, usando os delegados do manipulador de eventos especificados para salvar alterações e exibir a Ajuda e o parâmetro somente leitura especificado para o texto da caixa de diálogo.

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

Exibe uma caixa de diálogo para coletar informações de credencial.

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

Uma IServiceProvider interface que representa o provedor de serviços para coletar credenciais de usuário.

dialogTitleText
String

O título da caixa de diálogo.

userName
String

O nome do usuário.

password
String

A senha do usuário.

isModify
Boolean

Esse parâmetro é reservado para uso futuro.

verifyValidWindowsUserPassword
Boolean

true se a senha deve ser verificada para Windows; caso contrário, false.

description
String

Uma descrição do usuário.

setSpecificCredentialsText
String

O usuário específico.

otherOptionText
String

O usuário alternativo.

Retornos

Um CredentialInfo objeto criado com os parâmetros dessa sobrecarga.

Exemplos

O exemplo a seguir implementa esse 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;
} 

Comentários

Se o parâmetro estiver null ou vazio, o userName IIS usará a autenticação de passagem.

Aplica-se a

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

Exibe uma caixa de diálogo para coletar informações de credencial, usando o delegado de manipulador de eventos especificado para salvar alterações.

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

Uma IServiceProvider interface que representa o provedor de serviços para coletar credenciais de usuário.

dialogTitleText
String

O título da caixa de diálogo.

userName
String

O nome do usuário.

password
String

A senha do usuário.

isModify
Boolean

Esse parâmetro é reservado para uso futuro.

verifyValidWindowsUserPassword
Boolean

true se a senha deve ser verificada para Windows; caso contrário, false.

description
String

Uma descrição do usuário.

setSpecificCredentialsText
String

O usuário específico.

otherOptionText
String

O usuário alternativo.

commitHandler
EventHandler<CredentialInfoEventArgs>

O delegado manipulador de eventos usado para salvar alterações.

Retornos

Um CredentialInfo objeto criado com os parâmetros dessa sobrecarga.

Exemplos

O exemplo a seguir implementa esse 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;
} 

Comentários

Se o parâmetro estiver null ou vazio, o userName IIS usará a autenticação de passagem.

Aplica-se a

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

Exibe uma caixa de diálogo para coletar informações de credencial, usando os delegados do manipulador de eventos especificados para salvar alterações e exibir a Ajuda.

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

Uma IServiceProvider interface que representa o provedor de serviços para coletar credenciais de usuário.

dialogTitleText
String

O título da caixa de diálogo.

userName
String

O nome do usuário.

password
String

A senha do usuário.

isModify
Boolean

Esse parâmetro é reservado para uso futuro.

verifyValidWindowsUserPassword
Boolean

true se a senha deve ser verificada para Windows; caso contrário, false.

description
String

Uma descrição do usuário.

setSpecificCredentialsText
String

O usuário específico.

otherOptionText
String

O usuário alternativo.

commitHandler
EventHandler<CredentialInfoEventArgs>

O delegado manipulador de eventos usado para salvar alterações.

showHelp
EventHandler

O representante do manipulador de eventos usado para exibir a Ajuda.

Retornos

Um CredentialInfo objeto criado com os parâmetros dessa sobrecarga.

Exemplos

O exemplo a seguir implementa esse 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;
} 

Comentários

Se o parâmetro estiver null ou vazio, o userName IIS usará a autenticação de passagem.

Aplica-se a

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

Exibe uma caixa de diálogo para coletar informações de credencial, usando os delegados do manipulador de eventos especificados para salvar alterações e exibir a Ajuda e o parâmetro somente leitura especificado para o texto da caixa 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

Uma IServiceProvider interface que representa o provedor de serviços para coletar credenciais de usuário.

dialogTitleText
String

O título da caixa de diálogo.

userName
String

O nome do usuário.

password
String

A senha do usuário.

isModify
Boolean

Esse parâmetro é reservado para uso futuro.

verifyValidWindowsUserPassword
Boolean

true se a senha deve ser verificada para Windows; caso contrário, false.

description
String

Uma descrição do usuário.

setSpecificCredentialsText
String

O usuário específico.

otherOptionText
String

O usuário alternativo.

commitHandler
EventHandler<CredentialInfoEventArgs>

O delegado manipulador de eventos usado para salvar alterações.

showHelp
EventHandler

O representante do manipulador de eventos usado para exibir a Ajuda.

readOnly
Boolean

true se as caixas de texto na caixa de diálogo forem somente leitura; false se as caixas de texto forem de leitura/gravação.

Retornos

Um CredentialInfo objeto criado com os parâmetros dessa sobrecarga.

Exemplos

O exemplo a seguir implementa esse 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;
} 

Comentários

Se o parâmetro estiver null ou vazio, o userName IIS usará a autenticação de passagem. Se o readOnly parâmetro for false, os usuários poderão alterar o texto nas caixas de texto.

Aplica-se a