Share via


SecurityElement.SearchForChildByTag(String) メソッド

定義

タグ名を指定して子要素を検索します。

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

パラメーター

tag
String

子要素で検索するタグ。

戻り値

指定したタグ値を持つ最初の XML 子要素。または tag を持つ子要素が存在しない場合は null

例外

tag パラメーターが null です。

次のコードは、 メソッドを SearchForChildByTag 使用して、タグ名で子を検索する方法を示しています。 このコード例は、SecurityElement クラスのために提供されている大規模な例の一部です。

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

注釈

次のように XML を指定すると、 SearchForChildByTag("second") は子要素 <second>を返します。

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

適用対象