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);
member this.SearchForChildByTag : string -> System.Security.SecurityElement
Public Function SearchForChildByTag (tag As String) As SecurityElement

Parámetros

tag
String

Etiqueta para la que se va a buscar en elementos secundarios.

Devoluciones

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

Excepciones

El tag parámetro es null.

Ejemplos

El código siguiente muestra el uso del SearchForChildByTag método para buscar un elemento secundario por su nombre de etiqueta. Este ejemplo de código forma parte de un ejemplo más grande proporcionado para la SecurityElement clase .

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 secundario <second>.

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

Se aplica a