Binding.Protocol Propriété

Définition

Obtient ou définit le protocole que la liaison utilisera.

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

Valeur de propriété

Identificateur de protocole pour la liaison.

Exemples

L’exemple suivant illustre la Protocol propriété . Si l’identificateur de protocole est « https », le hachage du certificat et le nom du magasin de certificats s’affichent. Cet exemple de code fait partie d’un exemple plus grand fourni pour 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;
}

Remarques

La valeur « http » indique une liaison qui utilise le protocole HTTP. La valeur « https » indique une liaison qui utilise HTTP sur SSL.

La Protocol valeur de la propriété est conservée dans le fichier ApplicationHost.config.

S’applique à