ClientCredentials.UserName Właściwość

Definicja

Pobiera obiekt poświadczeń, którego można użyć do ustawienia nazwy użytkownika i hasła używanego przez klienta do uwierzytelniania się w usłudze.

public:
 property System::ServiceModel::Security::UserNamePasswordClientCredential ^ UserName { System::ServiceModel::Security::UserNamePasswordClientCredential ^ get(); };
public System.ServiceModel.Security.UserNamePasswordClientCredential UserName { get; }
member this.UserName : System.ServiceModel.Security.UserNamePasswordClientCredential
Public ReadOnly Property UserName As UserNamePasswordClientCredential

Wartość właściwości

Element UserNamePasswordClientCredential reprezentujący bieżące poświadczenia UserName.

Przykłady

Poniższy kod pokazuje, jak skonfigurować poświadczenie.

// Configure the proxy with
// (username,password).
calcClient.ClientCredentials.UserName.UserName = "username";
calcClient.ClientCredentials.UserName.Password = "changethispassword";
' Configure the proxy with 
' (username,password).
calcClient.ClientCredentials.UserName.UserName = "username"
calcClient.ClientCredentials.UserName.Password = "changethispassword"

Uwagi

Za pomocą obiektu zwróconego przez tę właściwość można skonfigurować poświadczenia, wywołując jego elementy członkowskie, takie jak UserName i Password.

Dotyczy