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 d’étiquette.
public:
System::Security::SecurityElement ^ SearchForChildByTag(System::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 pour laquelle effectuer une recherche dans les éléments enfants.
Retours
Premier élément XML enfant avec la valeur de balise spécifiée, ou null s’il n’existe aucun élément tag enfant.
Exceptions
Le tag paramètre est 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("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>