Private Sub Cmd_Save_As_XML_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cmd_Save_As_XML.Click Dim settings As New XmlWriterSettings() settings.Indent = True ' Initialize the XmlWriter. Dim XmlWrt As XmlWriter = XmlWriter.Create("C:\00temp\GoogleEarth_VaneTest.xml", settings) With XmlWrt ' Write the Xml declaration. .WriteStartDocument() ' Write a comment. .WriteComment("XML Database.") ' Write the root element. .WriteStartElement("Google") .WriteStartElement("name") .WriteStartElement(Txt_Name.Text.ToString()) .WriteEndElement() .WriteStartElement("description") .WriteStartElement(Txt_Description.Text.ToString()) .WriteEndElement() .WriteEndElement() ' Start our first lookat. .WriteStartElement("LookAt") ' The lookat nodes. .WriteStartElement("longitude") .WriteString(Txt_Longitude.Text.ToString()) .WriteEndElement() .WriteStartElement("latitude") .WriteString(+Txt_Latitude.Text.ToString()) .WriteEndElement() .WriteStartElement("altitude") .WriteString(Txt_Altitude.Text.ToString()) .WriteEndElement() .WriteStartElement("heading") .WriteString(Txt_Heading.Text.ToString()) .WriteEndElement() .WriteStartElement("titl") .WriteString(Txt_Tilt.Text.ToString()) .WriteEndElement() .WriteStartElement("range") .WriteString(Txt_Range.Text.ToString()) .WriteEndElement() .WriteStartElement("gxaltitudeMode") .WriteString(Txt_Altitude_Mode.Text.ToString()) .WriteEndElement() ' The end of this lookat. .WriteEndElement() .WriteStartElement("styleUrl") .WriteStartElement(Txt_Styleurl.Text.ToString()) .WriteEndElement() ' Start our first point. .WriteStartElement("Point") .WriteStartElement("gxdrawOrder") .WriteString(Txt_Draw_Order.Text.ToString()) .WriteEndElement() .WriteStartElement("coordinates") .WriteString(Txt_Longitude.Text.ToString() + Txt_Latitude.Text.ToString() + Txt_Altitude.Text.ToString()) .WriteEndElement() ' The end of this point. .WriteEndElement() ' Close the XmlTextWriter. .WriteEndDocument() .Close() End With MessageBox.Show("XML file saved successfully. In C:\00temp\") End Sub
mystring = mystring.Replace(" ", "_");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)