Freigeben über


TcpTransportSecurity.ClientCredentialType Eigenschaft

Definition

Ruft den Typ der Clientanmeldeinformationen ab, der zur Authentifizierung verwendet wird, oder legt diesen fest.

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

Eigenschaftswert

TcpClientCredentialType

Gibt TcpClientCredentialType zurück.

Beispiele

Der folgende Code zeigt, wie diese Eigenschaft aufgerufen und festgelegt wird.

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")

Hinweise

Der Rückgabewert kann einer der folgenden Enumerationsmember sein:

Gilt für