SecurityElement.SearchForChildByTag(String) Método

Definição

Localiza um filho pelo seu nome de marca.

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

A marca pela qual pesquisar nos elementos filho.

Retornos

SecurityElement

O primeiro elemento XML filho com o valor da marca especificado ou null, se nenhum elemento filho com tag existir.

Exceções

O parâmetro tag é null.

Exemplos

O código a seguir mostra o uso do SearchForChildByTag método para localizar um filho por seu nome de marca. Este exemplo de código faz parte de um exemplo maior fornecido para a SecurityElement classe.

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

Comentários

Com o XML da seguinte maneira, SearchForChildByTag("second") retornaria o elemento filho <second> .

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

Aplica-se a