SecurityElement.SearchForChildByTag(String) Metodo

Definizione

Rileva 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 da cercare negli elementi figlio.

Restituisce

Il primo elemento XML figlio con il valore di tag specificato oppure null se non esiste alcun elemento figlio con tag.

Eccezioni

Il valore del parametro tag è null.

Esempio

Il codice seguente mostra 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ù grande fornito per la SecurityElement classe.

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

Commenti

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

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

Si applica a