Share via


Binding.Protocol Eigenschaft

Definition

Ruft das Protokoll ab, das von der Bindung verwendet wird, oder legt es fest.

public:
 property System::String ^ Protocol { System::String ^ get(); void set(System::String ^ value); };
public string Protocol { get; set; }
member this.Protocol : string with get, set
Public Property Protocol As String

Eigenschaftswert

Der Protokollbezeichner für die Bindung.

Beispiele

Im folgenden Beispiel wird die Protocol -Eigenschaft veranschaulicht. Wenn der Protokollbezeichner "https" lautet, werden der Zertifikathash und der Name des Zertifikatspeichers angezeigt. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die Binding-Klasse bereitgestellt wird.

if (binding.Protocol == "https")
{
     // There is a CertificateHash and  
     // CertificateStoreName for the https protocol only.
    bindingdisplay = bindingdisplay + "\n   CertificateHash: " + 
        binding.CertificateHash + ": ";
    // Display the hash.
    foreach (System.Byte certhashbyte in binding.CertificateHash)
    {
        bindingdisplay = bindingdisplay + certhashbyte.ToString() + " ";
    }
    bindingdisplay = bindingdisplay + "\n   CertificateStoreName: " + 
        binding.CertificateStoreName;
}

Hinweise

Der Wert "http" gibt eine Bindung an, die das HTTP-Protokoll verwendet. Der Wert "https" gibt eine Bindung an, die HTTP über SSL verwendet.

Der Protocol -Eigenschaftswert wird in der ApplicationHost.config-Datei beibehalten.

Gilt für: