SecurityElement.Attribute(String) メソッド

定義

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

検索する属性の名前。

戻り値

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>  

適用対象