SecurityElement::SearchForChildByTag Method (String^)

 

Finds a child by its tag name.

Namespace:   System.Security
Assembly:  mscorlib (in mscorlib.dll)

public:
SecurityElement^ SearchForChildByTag(
	String^ tag
)

Parameters

tag
Type: System::String^

The tag for which to search in child elements.

Return Value

Type: System.Security::SecurityElement^

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

Exception Condition
ArgumentNullException

The tag parameter is null.

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>

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 )

.NET Framework
Available since 1.1
Return to top
Show: