SecurityElement.SearchForChildByTag(String) Metodo

Definizione

Trova un elemento figlio in base al nome del tag.

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

Parametri

tag
String

Tag per il quale eseguire la ricerca negli elementi figlio.

Valori restituiti

Primo elemento XML figlio con il valore del tag specificato o null se non esiste alcun elemento figlio con tag .

Eccezioni

Il tag parametro è null.

Esempio

Il codice seguente illustra l'uso del SearchForChildByTag metodo per trovare un elemento figlio in base al nome del tag. Questo esempio di codice fa parte di un esempio più ampio fornito per la SecurityElement classe .

if (localXmlElement.SearchForChildByTag("destroytime") != null)
If Not (localXmlElement.SearchForChildByTag("destroytime") Is Nothing) Then

Commenti

Con XML come indicato di seguito, SearchForChildByTag("second") restituirebbe l'elemento <second>figlio .

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

Si applica a