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 要素。nullを持つ子要素が存在しない場合はtag

例外

tag パラメーターはnull

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

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>

適用対象