MessageSecurityOverTcp.ClientCredentialType 属性

定义

指定客户端用于向 SOAP 级服务进行身份验证的客户端凭据类型。Specifies the type of client credential the client uses to authenticate itself to the service at the SOAP level.

public:
 property System::ServiceModel::MessageCredentialType ClientCredentialType { System::ServiceModel::MessageCredentialType get(); void set(System::ServiceModel::MessageCredentialType value); };
public System.ServiceModel.MessageCredentialType ClientCredentialType { get; set; }
member this.ClientCredentialType : System.ServiceModel.MessageCredentialType with get, set
Public Property ClientCredentialType As MessageCredentialType

属性值

MessageCredentialType

MessageCredentialTypeA MessageCredentialType. 默认值为 WindowsThe default is Windows.

例外

示例

下面的代码演示如何访问和设置此属性。The following code shows how to access and set this property.

NetTcpBinding binding = new NetTcpBinding();
// Specify the mode, then the credential type.
binding.Security.Mode = SecurityMode.Message;
binding.Security.Message.ClientCredentialType =
    MessageCredentialType.UserName;
binding.Security.Message.AlgorithmSuite =
    System.ServiceModel.Security.SecurityAlgorithmSuite.Basic256;
Dim binding As New NetTcpBinding()
' Specify the mode, then the credential type.
binding.Security.Mode = SecurityMode.Message
binding.Security.Message.ClientCredentialType = MessageCredentialType.UserName
binding.Security.Message.AlgorithmSuite = System.ServiceModel.Security.SecurityAlgorithmSuite.Basic256

注解

返回值可以是下列枚举成员之一:The return value can be one of the following enumeration members:

适用于