SecurityElement.Attribute(String) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
XML 要素で、名前を指定して属性を検索します。
public:
System::String ^ Attribute(System::String ^ name);
public string? Attribute (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(L"creationdate");
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>