Aracılığıyla paylaş


TcpTransportSecurity.ClientCredentialType Özellik

Tanım

Kimlik doğrulaması için kullanılan istemci kimlik bilgisi türünü alır veya ayarlar.

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

Özellik Değeri

döndürür TcpClientCredentialType.

Örnekler

Aşağıdaki kodda bu özelliğe nasıl erişilip ayarlanacağı gösterilmektedir.

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

Açıklamalar

Dönüş değeri aşağıdaki numaralandırma üyelerinden biri olabilir:

Şunlara uygulanır