Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I ended up solving this by using the method I described above. I simply deserialized the object and looped through each file, checking if the target file exists and comparing other data points. </p> <p>Here is the code:</p> <pre><code>Imports System.IO Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim objFolder As New Folder Dim strObjects As String = "" With New StreamReader("INPUT FILE PATH") strObjects = .ReadToEnd End With objFolder = DeserializeObject(strObjects, GetType(Folder)) CheckFiles(objFolder) End Sub Sub CheckFiles(ByVal oFolder As Folder) Dim FileName As String = "OUTPUT FILE PATH" Dim strWrite As String = "" For Each oFile In oFolder.lstFiles If System.IO.File.Exists(oFile.FullName) Then Dim fi As New FileInfo(oFile.FullName) If fi.LastWriteTime &lt;&gt; oFile.DateModified Then strWrite += vbCrLf &amp; oFile.Name &amp; "," &amp; oFile.FullName &amp; ",File Out of Date," &amp; oFile.DateModified End If Else strWrite += vbCrLf &amp; oFile.Name &amp; "," &amp; oFile.FullName &amp; ",File Does Not Exist," &amp; oFile.DateModified End If Next Dim sw As New StreamWriter(FileName, True) sw.Write(strWrite) sw.Close() sw.Dispose() For Each oFolder2 In oFolder.lstFolders CheckFiles(oFolder2) Next End Sub Public Shared Function SerializeObject(ByVal objToSerialize As Object) As String Dim objXML As New Xml.Serialization.XmlSerializer(objToSerialize.GetType) Dim sw As New IO.StringWriter() objXML.Serialize(sw, objToSerialize) Return sw.ToString() End Function Public Shared Function DeserializeObject(ByVal strSerializedObject As String, ByVal objType As Type) As Object Dim objXML As New Xml.Serialization.XmlSerializer(objType) Dim sr As New IO.StringReader(strSerializedObject) Return CType(objXML.Deserialize(sr), Object) End Function End Class &lt;Serializable(), Xml.Serialization.XmlInclude(GetType(File))&gt; _ Public Class Folder Public lstFiles As New List(Of File) Public lstFolders As New List(Of Folder) End Class &lt;Serializable()&gt; _ Public Class File Public Name As String Public FullName As String Public DateCreated As String Public DateModified As String End Class </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

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