|
Here's the code
I guess the code is self explanatory. If u need help. send me a mail or I might be online . Catch me there.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not System.IO.File.Exists("DABData.xml") Then
CreateXMLFile("DABData.xml")
End If
End Sub
Public Sub CreateXMLFile(ByVal FileName As String)
Dim oXMLTextWriter As New XmlTextWriter(FileName, Nothing)
' Starts a new document.
oXMLTextWriter.WriteStartDocument()
oXMLTextWriter.WriteStartElement("DAB")
' Add elements to the file
'Connection String
oXMLTextWriter.WriteStartElement("CONNECTIONSTRING")
oXMLTextWriter.WriteElementString("SERVER", "")
oXMLTextWriter.WriteElementString("DATABASE", "")
oXMLTextWriter.WriteElementString("USERNAME", "")
oXMLTextWriter.WriteElementString("PASSWORD", "")
oXMLTextWriter.WriteEndElement()
'Day
oXMLTextWriter.WriteStartElement("DAY")
oXMLTextWriter.WriteElementString("MON", "0")
oXMLTextWriter.WriteElementString("TUE", "0")
oXMLTextWriter.WriteElementString("WED", "0")
oXMLTextWriter.WriteElementString("THU", "0")
oXMLTextWriter.WriteElementString("FRI", "0")
oXMLTextWriter.WriteElementString("SAT", "0")
oXMLTextWriter.WriteElementString("SUN", "0")
oXMLTextWriter.WriteEndElement()
'BackUp Folder
oXMLTextWriter.WriteStartElement("BACKUPFOLDER")
oXMLTextWriter.WriteElementString("FOLDER", "C:\")
oXMLTextWriter.WriteEndElement()
'Time
oXMLTextWriter.WriteStartElement("TIME")
oXMLTextWriter.WriteElementString("HHMM", "17:0")
oXMLTextWriter.WriteEndElement()
' Ends the document
oXMLTextWriter.WriteEndElement()
oXMLTextWriter.WriteEndDocument()
oXMLTextWriter.Close()
End Sub
|