ClientCredentials 构造函数
定义
初始化 ClientCredentials 类的新实例。Initializes a new instance of the ClientCredentials class.
重载
| ClientCredentials() |
初始化 ClientCredentials 类的新实例。Initializes a new instance of the ClientCredentials class. |
| ClientCredentials(ClientCredentials) |
此为复制构造函数。This is a copy constructor. |
注解
使用此类的最常见方法是从客户端对象中访问其属性,而不是直接对其进行实例化。The most common way to use this class is to access its properties from the client object and not to instantiate it directly. 下面的代码演示如何执行此操作。The following code shows how to do this.
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 类的新实例。Initializes a new instance of the ClientCredentials class.
public:
ClientCredentials();
public ClientCredentials ();
Public Sub New ()
示例
使用此类的最常见方法是从客户端对象中访问其属性,而不是直接对其进行实例化。The most common way to use this class is to access its properties from the client object and not to instantiate it directly. 下面的代码演示如何执行此操作。The following code shows how to do this.
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 使用默认设置创建一个对象,例如, SupportInteractive = true 。This constructor creates a ClientCredentials object with default settings, for example, SupportInteractive = true.
适用于
ClientCredentials(ClientCredentials)
此为复制构造函数。This is a copy constructor.
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。A ClientCredentials. 新构造的实例的所有属性反映了此参数的值。All properties of the newly-constructed instance reflect the values of this parameter.
示例
使用此类的最常见方法是从客户端对象中访问其属性,而不是直接对其进行实例化。The most common way to use this class is to access its properties from the client object and not to instantiate it directly. 下面的代码演示如何执行此操作。The following code shows how to do this.
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");