SecurityMode 列舉

定義

決定繫結的安全性設定。

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

欄位

Message 2

系統會使用 SOAP 訊息安全性來提供安全性。

None 0

停用安全性。

Transport 1

安全性可使用安全性傳輸 (例如,HTTPS) 來提供。

TransportWithMessageCredential 3

安全性傳輸 (例如,HTTPS) 提供完整性、機密性和驗證,而 SOAP 訊息安全性會提供用戶端驗證。

範例

下列範例會設定 ModeWSHttpBinding 屬性。 如需更多範例,請參閱 如何:設定安全性模式

WSHttpBinding b = new WSHttpBinding();
b.Security.Mode = SecurityMode.Transport;
Dim b As New WSHttpBinding()
b.Security.Mode = SecurityMode.Transport

備註

如果 設定為 None, SecurityMode 則會忽略傳輸的任何 ProtectionLevel 設定。 如需屬性的詳細資訊 ProtectionLevel ,請參閱 瞭解保護層級

如需 Windows Communication Foundation (WCF) 安全性的詳細資訊,以及此屬性如何影響一般安全性功能,請參閱保護服務和程式設計 WCF 安全性。 如需傳輸模式的詳細資訊,請參閱 傳輸安全性

請注意,如果您選擇 TransportWithMessageCredential,則會忽略 或 TcpClientCredentialTypeHttpClientCredentialType 設定的值。

適用於