Option Strict On Public Class DiffForm Private Sub lblLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblLoad.Click Dim filename1 As String = txtFileName1.Text Dim filename2 As String = txtFilename2.Text Dim listA() As String = loadArrayData(filename1) Dim listB() As String = loadArrayData(filename2) DisplayItemsNotInB(listA, listB) DisplayItemsNotInA(listA, listB) End Sub Sub DisplayItemsNotInB(ByVal a() As String, ByVal b() As String) Dim diff() As String = itemDiff(a, b) lstInANotB.Items.Clear() For i As Integer = 0 To diff.GetUpperBound(0) lstInANotB.Items.Add(diff(i)) Next End Sub Sub DisplayItemsNotInA(ByVal a() As String, ByVal b() As String) Dim diff() As String = itemDiff(b, a) lstInBNotA.Items.Clear() For i As Integer = 0 To diff.GetUpperBound(0) lstInBNotA.Items.Add(diff(i)) Next End Sub Function itemDiff(ByVal listA() As String, ByVal listB() As String) As String() Dim diff() As String = {"No Differences"} ' **** YOU NEED TO WRITE THIS FUNCTION Return diff End Function Function loadArrayData(ByVal fname As String) As String() ' initialize the array where we will load the data into Dim myData(0) As String ' open the file Dim fh As IO.StreamReader Try fh = IO.File.OpenText(fname) Catch e As IO.FileNotFoundException Return mydata End Try ' keep track of the line number we are on (starting at 0) Dim line_num As Integer = 0 ' loop until we hit the end of the file Do While fh.Peek <> -1 ' make the array big enough ReDim Preserve myData(line_num) ' read a line from the data file and convert it to double and place in array myData(line_num) = fh.ReadLine ' increment the line number line_num += 1 Loop fh.Close() ' return the newly constructed array Return myData End Function End Class