Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>For anyone looking for the answer, please have a look at my solution that I figured out.</p> <p>[CODE] Sub main()</p> <pre><code> Dim doc As New System.Xml.XmlDocument Dim myJob As New Atr.backup.Job doc.Load("C:\users\matt taylor\desktop\backup\backup.xml") myLogger = New Logger("C:\users\matt taylor\desktop\backup\" + DateTime.Now.ToString("yyyy-MM-dd") + ".log") Console.SetWindowSize(100, 25) Dim JobNodes As XmlNodeList = doc.GetElementsByTagName("Job") Dim JobNode As XmlNode Dim baseDataNodes As XmlNodeList For Each JobNode In JobNodes baseDataNodes = JobNode.ChildNodes() For Each baseDataNode As XmlNode In baseDataNodes myJob.jobName = JobNode.SelectSingleNode("JobName").Name myJob.jobSource = JobNode.SelectSingleNode("Source").Name myJob.jobDestination = JobNode.SelectSingleNode("Destination").Name myJob.jobTimeStamp = JobNode.SelectSingleNode("Timestamp").Name Dim Source = JobNode.SelectNodes("Source") Dim Destin = JobNode.SelectNodes("Destination") Using zip As New ZipFile() For Each item As System.Xml.XmlNode In Source zip.AddFile(item.InnerText, JobNode.SelectSingleNode("JobName").InnerText &amp; "_Archive_" &amp; DateString) Next For Each item As System.Xml.XmlNode In Destin zip.Save(item.InnerText) Next End Using Console.Write(vbCrLf) Console.Write(baseDataNode.Name &amp; ": " &amp; baseDataNode.InnerText) myLogger.Log(baseDataNode.Name &amp; ": " &amp; baseDataNode.InnerText) Next Console.Write(vbCrLf) Console.Write(vbCrLf) Next Console.Read() End Sub[/CODE] </code></pre> <p>and then there is a public class named JOB i made for some of the routines.</p> <p>[CODE]Public Class Job</p> <pre><code> Private name As String Private source As String Private destination As String Private timeStamp As String Public Property jobName() As String Get Return name End Get Set(value As String) name = value End Set End Property Public Property jobSource() As String Get Return source End Get Set(value As String) source = value End Set End Property Public Property jobDestination() As String Get Return destination End Get Set(value As String) destination = value End Set End Property Public Property jobTimeStamp() As String Get Return timeStamp End Get Set(value As String) timeStamp = value End Set End Property[/CODE] </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload