共用方式為


NonDualMessageSecurityOverHttp.EstablishSecurityContext 屬性

定義

取得或設定值,這個值表示是否已建立安全性內容權杖。

public:
 property bool EstablishSecurityContext { bool get(); void set(bool value); };
public bool EstablishSecurityContext { get; set; }
member this.EstablishSecurityContext : bool with get, set
Public Property EstablishSecurityContext As Boolean

屬性值

如果已建立安全性內容權杖,則為 true,否則為 false

範例

下列程式碼將示範如何設定這個屬性。

WSHttpBinding binding = new WSHttpBinding();
binding.Security.Mode = SecurityMode.Message;
binding.Security.Message.AlgorithmSuite =
    System.ServiceModel.Security.SecurityAlgorithmSuite.Basic256;
binding.Security.Message.EstablishSecurityContext = true;
Dim binding As New WSHttpBinding()
binding.Security.Mode = SecurityMode.Message
binding.Security.Message.AlgorithmSuite = System.ServiceModel.Security.SecurityAlgorithmSuite.Basic256
binding.Security.Message.EstablishSecurityContext = True

備註

這個屬性會控制安全性內容權杖是否透過用戶端與伺服器之間的 WS-SecureConversation 交換來建立。 將它設定為 true 需要遠端合作物件支援 WS-SecureConversation。

適用於