SecurityElement::SearchForChildByTag Method (String^)
.NET Framework (current version)
Finds a child by its tag name.
Assembly: mscorlib (in mscorlib.dll)
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.
.NET Framework
Available since 1.1
Available since 1.1
Show: