本文整理汇总了VB.NET中System.Xml.XmlAttributeCollection.ItemOf属性的典型用法代码示例。如果您正苦于以下问题:VB.NET XmlAttributeCollection.ItemOf属性的具体用法?VB.NET XmlAttributeCollection.ItemOf怎么用?VB.NET XmlAttributeCollection.ItemOf使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。
在下文中一共展示了XmlAttributeCollection.ItemOf属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Sample
' 导入命名空间
Imports System.IO
Imports System.Xml
public class Sample
public shared sub Main()
Dim doc as XmlDocument = new XmlDocument()
doc.LoadXml("<book genre='novel' ISBN='1-861001-57-5'>" & _
"<title>Pride And Prejudice</title>" & _
"</book>")
'Create an attribute collection.
Dim attrColl as XmlAttributeCollection = doc.DocumentElement.Attributes
Console.WriteLine("Display all the attributes in the collection...")
Dim i as integer
for i=0 to attrColl.Count-1
Console.Write("{0} = ", attrColl.ItemOf(i).Name)
Console.Write("{0}", attrColl.ItemOf(i).Value)
Console.WriteLine()
next
end sub
end class
示例2: Sample
' 导入命名空间
Imports System.IO
Imports System.Xml
public class Sample
public shared sub Main()
Dim doc as XmlDocument = new XmlDocument()
doc.LoadXml("<book genre='novel' ISBN='1-861001-57-5'>" & _
"<title>Pride And Prejudice</title>" & _
"</book>")
'Create an attribute collection and remove an attribute
'from the collection.
Dim attrColl as XmlAttributeCollection = doc.DocumentElement.Attributes
attrColl.Remove(attrColl.ItemOf("genre"))
Console.WriteLine("Display the modified XML...")
Console.WriteLine(doc.OuterXml)
end sub
end class