Condividi tramite


Binding.Protocol Proprietà

Definizione

Ottiene o imposta il protocollo che verrà usato dall'associazione.

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

Valore della proprietà

Identificatore del protocollo per l'associazione.

Esempio

Nell'esempio seguente viene illustrata la Protocol proprietà . Se l'identificatore del protocollo è "https", vengono visualizzati l'hash del certificato e il nome dell'archivio certificati. Questo esempio di codice fa parte di un esempio più grande fornito per la Binding classe.

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;
}

Commenti

Un valore "http" indica un'associazione che usa il protocollo HTTP. Un valore "https" indica un'associazione che usa HTTP su SSL.

Il valore della Protocol proprietà viene mantenuto nel file di ApplicationHost.config.

Si applica a