HttpClientCredentialType 列舉

定義

列舉 HTTP 用戶端的有效認證型別。Enumerates the valid credential types for HTTP clients.

public enum class HttpClientCredentialType
public enum HttpClientCredentialType
type HttpClientCredentialType = 
Public Enum HttpClientCredentialType
繼承
HttpClientCredentialType

欄位

Basic 1

指定基本驗證。Specifies Basic authentication. 如需詳細資訊,請參閱 RFC 2617 - HTTP 驗證:基本和摘要式驗證For more information, see RFC 2617 - HTTP Authentication: Basic and Digest Authentication.

Certificate 5

使用憑證指定用戶端驗證。Specifies client authentication using a certificate.

Digest 2

指定摘要式驗證。Specifies Digest authentication. 如需詳細資訊,請參閱 RFC 2617 - HTTP 驗證:基本和摘要式驗證For more information, see RFC 2617 - HTTP Authentication: Basic and Digest Authentication.

InheritedFromHost 6

驗證繼承自主機。The authentication is inherited from the host.

None 0

指定匿名驗證。Specifies anonymous authentication.

Ntlm 3

使用 NTLM 指定用戶端驗證。Specifies client authentication using NTLM.

Windows 4

使用 Windows 指定用戶端驗證。Specifies client authentication using Windows.

範例

下列程式碼示範如何將 ClientCredentialType 設定為這個列舉的成員。The following code shows how to set ClientCredentialType to a member of this enumeration.

// The code uses a shortcut to specify the security mode to Transport.
WSHttpBinding b = new WSHttpBinding(SecurityMode.Transport);
b.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
' The code uses a shortcut to specify the security mode to Transport.
Dim b As WSHttpBinding = New WSHttpBinding(SecurityMode.Transport)
b.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows

備註

ClientCredentialType 會使用這個列舉,來指定驗證所要使用的用戶端認證型別。This enumeration is used by ClientCredentialType to specify the type of client credential to be used for authentication.

請注意,如果 SecurityMode 設為 TransportWithMessageCredential,則會忽略 HttpClientCredentialType 的值。Note that if SecurityMode is set to TransportWithMessageCredential, then the value of HttpClientCredentialType is ignored.

適用於