Generar XML con VB.Net 2010

Aquí les dejo un pequeño ejemplo de como generar un archivo XML.

Dim settings As New XmlWriterSettings()
settings.Indent = True
settings.IndentChars = " "
Using writer As XmlWriter = XmlWriter.Create("C:\Download\books.xml", settings)
	writer.WriteStartElement("book")
	writer.WriteElementString("<Nombre Campo>", "<Valor>")
	writer.WriteElementString("Product1", "50 Kg")
	writer.WriteElementString("Product2", "$ 500.23")
	writer.WriteEndElement()
	writer.Flush()
End Using

					
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s