The Program has two files USpres.txt, and usSenate, the program needs to display all presidents that served in the US.Senate. The problem is fixed with the code below. Thanks
Code:Public Class frmUSPRES Dim strUSPres, strUSSenate As String Private Sub btnCompute_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnCompute.Click Dim sr1 As IO.StreamReader = IO.File.OpenText("uspres.txt") Do While sr1.Peek <> -1 strUSPres = sr1.ReadLine Dim sr2 As IO.StreamReader = IO.File.OpenText("ussenate.txt") Do While sr2.Peek <> -1 strUSSenate = sr2.ReadLine If strUSPres = strUSSenate Then strUSPres = strUSSenate lstOutput.Items.Add(strUSPres) End If Loop Loop




Reply With Quote