Editare

Partajați prin


ClientCredentials.UserName Property

Definition

Gets a credential object that you can use to set the user name and password that the client uses to authenticate itself to the service.

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

Property Value

A UserNamePasswordClientCredential that represents the current UserName credential.

Examples

The following code shows how to configure a credential.

// 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"

Remarks

You can use the object returned by this property to configure the credential by calling its members, such as UserName and Password.

Applies to