Partager via


GacMembershipCondition.GetHashCode Méthode

Définition

Obtient un code de hachage pour la condition d’appartenance actuelle.

public:
 override int GetHashCode();
public override int GetHashCode ();
override this.GetHashCode : unit -> int
Public Overrides Function GetHashCode () As Integer

Retours

Int32

0 (zéro).

Exemples

L’exemple de code suivant montre l’utilisation de la GetHashCode méthode. Cet exemple fait partie d’un exemple plus grand fourni pour la GacMembershipCondition classe.

GacMembershipCondition ^ Gac1 = gcnew GacMembershipCondition;
try
{
    Console::WriteLine(
        "Result of GetHashCode for a GacMembershipCondition = {0}\n",
        Gac1->GetHashCode());
}
catch (Exception^ e) 
{
     Console::WriteLine("GetHashCode failed : {0}{1}", Gac1, e);
     return false;
}
GacMembershipCondition Gac1 = new GacMembershipCondition();
try
{
    Console.WriteLine(
        "Result of GetHashCode for a GacMembershipCondition = " + 
        Gac1.GetHashCode().ToString() + "\n");
}
catch (Exception e)
{
    Console.WriteLine("GetHashCode failed : " + Gac1.ToString() + e);
    return false;
}
Dim Gac1 As New GacMembershipCondition
Try
    Console.WriteLine( _
        ("Result of GetHashCode for a GacMembershipCondition = " _
        & Gac1.GetHashCode().ToString() & ControlChars.Lf))
Catch e As Exception
    Console.WriteLine(("GetHashCode failed : " & _
        Gac1.ToString() & e.ToString()))
    Return False
End Try

Remarques

La GetHashCode méthode retourne 0 (zéro), car GacMembershipCondition les objets n’ont aucune propriété pour les distinguer d’un autre.

S’applique à