SecurityElement.SearchForChildByTag(String) 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.
Recherche un enfant par son nom de balise.
public:
System::Security::SecurityElement ^ SearchForChildByTag(System::String ^ tag);
public System.Security.SecurityElement? SearchForChildByTag (string tag);
public System.Security.SecurityElement SearchForChildByTag (string tag);
member this.SearchForChildByTag : string -> System.Security.SecurityElement
Public Function SearchForChildByTag (tag As String) As SecurityElement
Paramètres
- tag
- String
Balise à rechercher dans les éléments enfants.
Retours
Premier élément enfant XML ayant la valeur de balise spécifiée, ou null
s'il n'existe aucun élément enfant doté de la balise tag
.
Exceptions
Le paramètre tag
a la valeur null
.
Exemples
Le code suivant montre l’utilisation de la SearchForChildByTag méthode pour rechercher un enfant par son nom de balise. Cet exemple de code fait partie d’un exemple plus grand fourni pour la SecurityElement classe .
if ( localXmlElement->SearchForChildByTag( L"destroytime" ) != nullptr )
if (localXmlElement.SearchForChildByTag("destroytime") != null)
If Not (localXmlElement.SearchForChildByTag("destroytime") Is Nothing) Then
Remarques
Avec XML comme suit, SearchForChildByTag("second")
retourne l’élément <second>
enfant .
<thetag A="123" B="456" C="789"> <first>text1</first>
<second>text2</second></thetag>
S’applique à
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de l’année 2024, nous abandonnerons progressivement le mécanisme de retour d’information GitHub Issues pour le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultez :Soumettre et afficher des commentaires pour