ClientBase<TChannel>.ClientCredentials ClientBase<TChannel>.ClientCredentials ClientBase<TChannel>.ClientCredentials ClientBase<TChannel>.ClientCredentials Property

定義

操作を呼び出すために使用されるクライアント資格情報を取得します。Gets the client credentials used to call an operation.

public:
 property System::ServiceModel::Description::ClientCredentials ^ ClientCredentials { System::ServiceModel::Description::ClientCredentials ^ get(); };
public System.ServiceModel.Description.ClientCredentials ClientCredentials { get; }
member this.ClientCredentials : System.ServiceModel.Description.ClientCredentials
Public ReadOnly Property ClientCredentials As ClientCredentials

プロパティ値

クライアントによって提示される id の証明。The proof of identity presented by the client.

次のコードは、ClientCredentials プロパティを使用して、サービスを呼び出す前に、ユーザー名とパスワードを設定する方法を示しています。The following code shows how to use the ClientCredentials property to set the username and password prior to calling the service.

// Specify client credentials on the client. 
// Code to set the UserName and Password is not shown here.
CalculatorClient CalculatorClient = new CalculatorClient("myBinding");
CalculatorClient.ClientCredentials.UserName.UserName = ReturnUserName();
CalculatorClient.ClientCredentials.UserName.Password = ReturnPassword();
' Specify client credentials on the client. 
' Code to set the UserName and Password is not shown here.
Dim CalculatorClient As New CalculatorClient("myBinding")
CalculatorClient.ClientCredentials.UserName.UserName = ReturnUserName()
CalculatorClient.ClientCredentials.UserName.Password = ReturnPassword()

注釈

ClientCredentials プロパティを使用して、ClientBase<TChannel> オブジェクトがサービスに接続するために使用する資格情報を構成します。Use the ClientCredentials property to configure the credentials that the ClientBase<TChannel> object uses to connect to the service.

適用対象

こちらもご覧ください