Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
ClientBase<TChannel>.ClientCredentials Property
Definition
- Namespace:
- System.ServiceModel
- Assemblies:
- System.ServiceModel.dll, System.ServiceModel.Primitives.dll
- Assembly:
- System.ServiceModel.Primitives.dll
- Assembly:
- System.ServiceModel.dll
- Package:
- System.ServiceModel.Primitives v10.0.652802
- Source:
- ClientBase.cs
- Source:
- ClientBase.cs
- Source:
- ClientBase.cs
Important
Some information relates to prerelease product that may be substantially modified before itβs released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Property Value
The proof of identity presented by the client.
Examples
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()
Remarks
Use the ClientCredentials property to configure the credentials that the ClientBase<TChannel> object uses to connect to the service.
Applies to
See also
Feedback
Was this page helpful?
