SecurityElement.Attribute(String) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
XML 要素内の名前で属性を検索します。
public:
System::String ^ Attribute(System::String ^ name);
public string Attribute(string name);
member this.Attribute : string -> string
Public Function Attribute (name As String) As String
パラメーター
- name
- String
検索する属性の名前。
返品
名前付き属性に関連付けられている値。nameを持つ属性が存在しない場合はnull。
例外
name パラメーターはnull。
例
次のコードは、 Attribute メソッドを使用して名前で属性を検索する方法を示しています。 このコード例は、 SecurityElement クラスに提供されるより大きな例の一部です。
string xmlCreationDate = xmlElement.Attribute("creationdate");
Dim xmlCreationDate As String = xmlElement.Attribute("creationdate")
注釈
次のように XML を使用すると、 Attribute("B") は "456" を返します。
<thetag A="123" B="456" C="789">text</thetag>