本文整理汇总了VB.NET中System.Xml.XmlWriterSettings.NewLineOnAttributes属性的典型用法代码示例。如果您正苦于以下问题:VB.NET XmlWriterSettings.NewLineOnAttributes属性的具体用法?VB.NET XmlWriterSettings.NewLineOnAttributes怎么用?VB.NET XmlWriterSettings.NewLineOnAttributes使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Xml.XmlWriterSettings
的用法示例。
在下文中一共展示了XmlWriterSettings.NewLineOnAttributes属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: XmlWriterSettings
Dim settings As New XmlWriterSettings()
settings.Indent = True
settings.OmitXmlDeclaration = True
settings.NewLineOnAttributes = True
writer = XmlWriter.Create(Console.Out, settings)
writer.WriteStartElement("order")
writer.WriteAttributeString("orderID", "367A54")
writer.WriteAttributeString("date", "2001-05-03")
writer.WriteElementString("price", "19.95")
writer.WriteEndElement()
writer.Flush()
示例2: MainClass
' 导入命名空间
Imports System.Xml
Imports System.Xml.Serialization
Imports System.IO
Public Class MainClass
Public Shared Sub Main()
Dim myXmlSettings As New XmlWriterSettings
myXmlSettings.Indent = True
myXmlSettings.NewLineOnAttributes = True
Using ProductWriter As XmlWriter = XmlWriter.Create("test.xml", myXmlSettings)
ProductWriter.WriteComment("www.java2s.com ")
ProductWriter.WriteStartElement("Product")
ProductWriter.WriteAttributeString("Id", "101")
ProductWriter.WriteAttributeString("COunt", "10")
ProductWriter.WriteElementString("P1", "P2")
ProductWriter.WriteEndElement()
End Using
End Sub
End Class