ClientCredentials 构造函数

定义

初始化 ClientCredentials 类的新实例。

重载

ClientCredentials()

初始化 ClientCredentials 类的新实例。

ClientCredentials(ClientCredentials)

此为复制构造函数。

注解

使用此类的最常见方法是从客户端对象中访问其属性,而不是直接对其进行实例化。 下面的代码演示如何执行此操作。

WSHttpBinding b = new WSHttpBinding();
EndpointAddress ea = new EndpointAddress("http://localhost/Calculator");
CalculatorClient client = new CalculatorClient(b, ea);
IssuedTokenClientCredential itcc = client.ClientCredentials.IssuedToken;

itcc.LocalIssuerAddress = new EndpointAddress("http://fabrikam.com/sts");

ClientCredentials()

初始化 ClientCredentials 类的新实例。

public:
 ClientCredentials();
public ClientCredentials ();
Public Sub New ()

示例

使用此类的最常见方法是从客户端对象中访问其属性,而不是直接对其进行实例化。 下面的代码演示如何执行此操作。

WSHttpBinding b = new WSHttpBinding();
EndpointAddress ea = new EndpointAddress("http://localhost/Calculator");
CalculatorClient client = new CalculatorClient(b, ea);
IssuedTokenClientCredential itcc = client.ClientCredentials.IssuedToken;

itcc.LocalIssuerAddress = new EndpointAddress("http://fabrikam.com/sts");

注解

此构造函数创建一个ClientCredentials具有默认设置的对象,例如 = SupportInteractivetrue

适用于

ClientCredentials(ClientCredentials)

此为复制构造函数。

protected:
 ClientCredentials(System::ServiceModel::Description::ClientCredentials ^ other);
protected ClientCredentials (System.ServiceModel.Description.ClientCredentials other);
new System.ServiceModel.Description.ClientCredentials : System.ServiceModel.Description.ClientCredentials -> System.ServiceModel.Description.ClientCredentials
Protected Sub New (other As ClientCredentials)

参数

other
ClientCredentials

ClientCredentials。 新构造的实例的所有属性反映了此参数的值。

示例

使用此类的最常见方法是从客户端对象中访问其属性,而不是直接对其进行实例化。 下面的代码演示如何执行此操作。

WSHttpBinding b = new WSHttpBinding();
EndpointAddress ea = new EndpointAddress("http://localhost/Calculator");
CalculatorClient client = new CalculatorClient(b, ea);
IssuedTokenClientCredential itcc = client.ClientCredentials.IssuedToken;

itcc.LocalIssuerAddress = new EndpointAddress("http://fabrikam.com/sts");

适用于