Επεξεργασία

Κοινή χρήση μέσω


SecurityElement.SearchForChildByTag(String) Method

Definition

Finds a child by its tag name.

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

Parameters

tag
String

The tag for which to search in child elements.

Returns

The first child XML element with the specified tag value, or null if no child element with tag exists.

Exceptions

The tag parameter is null.

Examples

The following code shows the use of the SearchForChildByTag method to find a child by its tag name. This code example is part of a larger example provided for the SecurityElement class.

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

Remarks

With XML as follows, SearchForChildByTag("second") would return the child element <second>.

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

Applies to