UserNamePasswordClientCredential.Password 属性

定义

获取或设置密码。

public:
 property System::String ^ Password { System::String ^ get(); void set(System::String ^ value); };
public string Password { get; set; }
member this.Password : string with get, set
Public Property Password As String

属性值

密码。

注解

若要获取或设置此属性,请访问客户端对象的 UserNamePasswordClientCredential 属性的 UserName 对象,如下面的代码所示。

WSHttpBinding myBinding = new WSHttpBinding();
myBinding.Security.Mode = SecurityMode.Message;
myBinding.Security.Message.ClientCredentialType =
    MessageCredentialType.UserName;

CalculatorClient client = new CalculatorClient("default");

client.ClientCredentials.UserName.Password = ReturnPassword();

client.ClientCredentials.UserName.UserName = ReturnUsername();
Dim myBinding As New WSHttpBinding()
myBinding.Security.Mode = SecurityMode.Message
myBinding.Security.Message.ClientCredentialType = MessageCredentialType.UserName


Dim client As New CalculatorClient("default")

client.ClientCredentials.UserName.Password = ReturnPassword()

client.ClientCredentials.UserName.UserName = ReturnUsername()

适用于