語言

MessageSecurityOverTcp.ClientCredentialType 屬性

定義

指定用戶端用何種憑證類型來在 SOAP 層級驗證服務。

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。 預設值為 Windows。

例外狀況

範例

以下程式碼說明如何存取並設定此屬性。

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

備註

回傳值可為下列列舉成員之一:

適用於