SecurityElement.SearchForChildByTag(String) Méthode

Définition

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

SecurityElement

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 illustre 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 complet 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 enfant <second> .

<thetag A="123" B="456" C="789"> <first>text1</first>  
       <second>text2</second></thetag>  

S’applique à