Share via


SecurityElement.Attributes プロパティ

定義

名前/値ペアとして、XML 要素の属性を取得または設定します。

public:
 property System::Collections::Hashtable ^ Attributes { System::Collections::Hashtable ^ get(); void set(System::Collections::Hashtable ^ value); };
public System.Collections.Hashtable Attributes { get; set; }
public System.Collections.Hashtable? Attributes { get; set; }
member this.Attributes : System.Collections.Hashtable with get, set
Public Property Attributes As Hashtable

プロパティ値

XML 要素の属性値の Hashtable オブジェクト。

例外

Hashtable オブジェクトの名前または値が無効です。

名前は有効な XML 属性名ではありません。

次のコードは、 プロパティを Attributes 使用して XML 要素の属性を取得する方法を示しています。 このコード例は、SecurityElement クラスのために提供されている大規模な例の一部です。

Hashtable^ attributeKeys = xmlElement->Attributes;
String^ attributeValue = attributeKeys[ attributeName ]->ToString();
Hashtable attributeKeys = xmlElement.Attributes;
string attributeValue = attributeKeys[attributeName].ToString();
Dim attributeKeys As Hashtable = xmlElement.Attributes
Dim attributeValue As String = attributeKeys(attributeName).ToString()

注釈

各属性は、名前と値のペアとして に Hashtable 格納されます。

属性の名前と値には、有効な XML 属性文字のみを含める必要があります。 文字列から無効な文字を削除するには、 を使用 Escape します。

引用符で囲まれた文字列はサポートされていないため、名前と値のペアの文字列には引用符や引用符を必要とする他の文字を含めないようにしてください。

適用対象