Dieser Artikel wurde noch nicht bewertet - Dieses Thema bewerten.

XmlAttributeCollection.ItemOf-Eigenschaft (Int32)

Ruft das Attribut mit dem angegebenen Index ab.

Namespace: System.Xml
Assembly: System.Xml (in system.xml.dll)

public XmlAttribute this [
	int i
] { get; }
/** @property */
public XmlAttribute get_ItemOf (int i)

Nicht zutreffend.

Parameter

i

Der Index des Attributs.

Eigenschaftenwert

Das XmlAttribute am angegebenen Index.

Diese Eigenschaft ist eine Microsoft-Erweiterung des Dokumentobjektmodells (Document Object Model, DOM). Sie entspricht dem Aufruf von XmlNamedNodeMap.Item.

Im folgenden Beispiel werden alle Attribute in der Auflistung angezeigt.

using System;
using System.IO;
using System.Xml;

public class Sample
{
  public static void Main(){
  
    XmlDocument doc = new XmlDocument();
    doc.LoadXml("<book genre='novel' ISBN='1-861001-57-5'>" +
                "<title>Pride And Prejudice</title>" +
                "</book>");      

    //Create an attribute collection. 
    XmlAttributeCollection attrColl = doc.DocumentElement.Attributes;

    Console.WriteLine("Display all the attributes in the collection...\r\n");
    for (int i=0; i < attrColl.Count; i++)
    {
      Console.Write("{0} = ", attrColl[i].Name);
      Console.Write("{0}", attrColl[i].Value);
      Console.WriteLine();
    }           
  }
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

Microsoft .NET Framework 3.0 wird unter Windows Vista, Microsoft Windows XP SP2 und Windows Server 2003 SP1 unterstützt.

.NET Framework

Unterstützt in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Unterstützt in: 2.0, 1.0

XNA Framework

Unterstützt in: 1.0
Fanden Sie dies hilfreich?
(1500 verbleibende Zeichen)
© 2013 Microsoft. Alle Rechte vorbehalten.