Compartir a través de


TcpTransportSecurity.ClientCredentialType Propiedad

Definición

Obtiene o establece el tipo de credenciales del cliente utilizado para la autenticación.

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

Valor de propiedad

Devuelve TcpClientCredentialType.

Ejemplos

En el siguiente fragmento de código se muestra cómo acceder y establecer esta propiedad.

NetTcpBinding b = new NetTcpBinding();
b.Security.Mode = SecurityMode.Transport;
b.Security.Transport.ClientCredentialType = TcpClientCredentialType.Certificate;
EndpointAddress a = new EndpointAddress("net.tcp://contoso.com/TcpAddress");
ChannelFactory<ICalculator> cf = new ChannelFactory<ICalculator>(b, a);
cf.Credentials.ClientCertificate.SetCertificate(
    StoreLocation.LocalMachine,
    StoreName.My,
    X509FindType.FindByThumbprint,
    "0000000000000000000000000000000000000000");
Dim b As NetTcpBinding = New NetTcpBinding()
b.Security.Mode = SecurityMode.Transport
b.Security.Transport.ClientCredentialType = TcpClientCredentialType.Certificate
Dim a As New EndpointAddress("net.tcp://contoso.com/TcpAddress")
Dim cf As ChannelFactory(Of ICalculator) = New ChannelFactory(Of ICalculator)(b, a)
cf.Credentials.ClientCertificate.SetCertificate( _
    StoreLocation.LocalMachine, _
    StoreName.My, _
    X509FindType.FindByThumbprint, _
    "0000000000000000000000000000000000000000")

Comentarios

El valor devuelto puede ser uno de los miembros de enumeración siguientes:

Se aplica a