GacMembershipCondition.ToString Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Retourne une chaîne représentant la condition d'appartenance.
public:
override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String
Retours
Chaîne représentant la condition d'appartenance.
Implémente
Exemples
L’exemple de code suivant montre l’utilisation de la ToString méthode . Cet exemple fait partie d’un exemple plus grand fourni pour la GacMembershipCondition classe .
GacMembershipCondition ^ Gac1 = gcnew GacMembershipCondition;
GacMembershipCondition ^ Gac2 = gcnew GacMembershipCondition;
// Roundtrip a GacMembershipCondition to and from an XML encoding.
Gac2->FromXml(Gac1->ToXml());
bool result = Gac2->Equals(Gac1);
if (result)
{
Console::WriteLine("Result of ToXml() = {0}", Gac2->ToXml());
Console::WriteLine(
"Result of ToFromXml roundtrip = {0}", Gac2);
}
else
{
Console::WriteLine(Gac2->ToString());
Console::WriteLine(Gac1->ToString());
return false;
}
GacMembershipCondition Gac1 = new GacMembershipCondition();
GacMembershipCondition Gac2 = new GacMembershipCondition();
// Roundtrip a GacMembershipCondition to and from an XML encoding.
Gac2.FromXml(Gac1.ToXml());
bool result = Gac2.Equals(Gac1);
if (result)
{
Console.WriteLine(
"Result of ToXml() = " + Gac2.ToXml().ToString());
Console.WriteLine(
"Result of ToFromXml roundtrip = " + Gac2.ToString());
}
else
{
Console.WriteLine(Gac2.ToString());
Console.WriteLine(Gac1.ToString());
return false;
}
Dim Gac1 As New GacMembershipCondition
Dim Gac2 As New GacMembershipCondition
' Roundtrip a GacMembershipCondition to and from an XML encoding.
Gac2.FromXml(Gac1.ToXml())
Dim result As Boolean = Gac2.Equals(Gac1)
If result Then
Console.WriteLine(("Result of ToXml() = " & _
Gac2.ToXml().ToString()))
Console.WriteLine(("Result of ToFromXml roundtrip = " & _
Gac2.ToString()))
Else
Console.WriteLine(Gac2.ToString())
Console.WriteLine(Gac1.ToString())
Return False
End If
Remarques
La représentation sous forme de chaîne pour GacMembershipCondition est « GAC ».