Created
May 10, 2012 03:12
-
-
Save mrowles/2650810 to your computer and use it in GitHub Desktop.
Convert C# Form Data to XML File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Protected Sub FormToXML (ByVal sender As Object, ByVal e As System.EventArgs) | |
// Create the XML document object with specified parametres | |
Dim XMLDoc As XDocument | |
XMLDoc = New XDocument( | |
New XDeclaration("1.0", "utf-8", "yes"), | |
New XElement("user", | |
New XElement("details", | |
New XElement("firstname", Firstname.Text), | |
New XElement("surname", Lastname.Text) | |
) | |
) | |
) | |
// Save test file | |
XMLDoc.Save("C:\test.xml") | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment