SecurityElement.SearchForChildByTag(String) Método

Definición

Busca un elemento secundario por su nombre de etiqueta.

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

Parámetros

tag
String

Etiqueta que se va a buscar en los elementos secundarios.

Devoluciones

El primer elemento XML secundario con el valor de etiqueta especificado o null si no existe ningún elemento secundario con tag.

Excepciones

El parámetro tag es null.

Ejemplos

En el código siguiente se muestra el uso del SearchForChildByTag método para buscar un elemento secundario por su nombre de etiqueta. Este ejemplo de código es parte de un ejemplo mayor proporcionado para la clase SecurityElement.

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

Comentarios

Con XML como se indica a continuación, SearchForChildByTag("second") devolvería el elemento <second>secundario .

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

Se aplica a