Public Class frmCombine

  Dim firstSet() As String = IO.File.ReadAllLines("FILE1.txt")
  Dim secondSet() As String = IO.File.ReadAllLines("FILE2.txt")

  Private Sub btnConcat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConcat.Click
    IO.File.WriteAllLines("Concat.txt", firstSet.Concat(secondSet))
  End Sub

  Private Sub btnUnion_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUnion.Click
    IO.File.WriteAllLines("Union.txt", firstSet.Union(secondSet))
  End Sub

  Private Sub btnIntersect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnIntersect.Click
    IO.File.WriteAllLines("Intersect.txt", firstSet.Intersect(secondSet))
  End Sub

  Private Sub btnExcept_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExcept.Click
    IO.File.WriteAllLines("Delete.txt", firstSet.Except(secondSet))
  End Sub

End Class
