次の方法で共有


SecurityElement.SearchForTextOfTag メソッド

タグ名を指定して子要素を検索し、格納されているテキストを返します。

Public Function SearchForTextOfTag( _
   ByVal tag As String _) As String
[C#]
public string SearchForTextOfTag(stringtag);
[C++]
public: String* SearchForTextOfTag(String* tag);
[JScript]
public function SearchForTextOfTag(
   tag : String) : String;

パラメータ

  • tag
    子要素で検索するタグ。

戻り値

指定したタグ値を持つ最初の子要素のテキストの内容。

例外

例外の種類 条件
ArgumentNullException tag が null 参照 (Visual Basic では Nothing) です。

解説

このメソッドは、次のコードと等価です。

 
String SearchForTextOfTag(String tag) { 
    SecurityElement element = this.SearchForChildByTag(tag);
    return element.Text;
 }
   

次の XML で、 SearchForTextOfTag("second") は "text2" を返します。

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

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

SecurityElement クラス | SecurityElement メンバ | System.Security 名前空間