Click here to Skip to main content
15,920,513 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: WinSock, how to pass from server to LAN's PC through internet Pin
Dave Kreskowiak19-Aug-04 5:22
mveDave Kreskowiak19-Aug-04 5:22 
GeneralFacing problem while calling C# Functions(DLL) from Visual Basic(EXE) Pin
Ami Shah18-Aug-04 21:10
Ami Shah18-Aug-04 21:10 
GeneralRe: Facing problem while calling C# Functions(DLL) from Visual Basic(EXE) Pin
Dave Kreskowiak19-Aug-04 3:57
mveDave Kreskowiak19-Aug-04 3:57 
GeneralAdding a text file in my project. Pin
Ravi S.V.18-Aug-04 20:10
Ravi S.V.18-Aug-04 20:10 
GeneralRe: Adding a text file in my project. Pin
Purple Monk19-Aug-04 1:41
Purple Monk19-Aug-04 1:41 
GeneralRe: Adding a text file in my project. Pin
Dave Kreskowiak19-Aug-04 3:34
mveDave Kreskowiak19-Aug-04 3:34 
GeneralCompare 2 different data file Pin
sumiko18-Aug-04 20:06
sumiko18-Aug-04 20:06 
GeneralRe: Compare 2 different data file Pin
Dave Kreskowiak19-Aug-04 3:32
mveDave Kreskowiak19-Aug-04 3:32 
It would help if you posted the code you have already and what your having problems with.

But basically, your going to open 2 StreamReader's, one for each file. Then, as you ReadLine a single line from each file, you increment a counter to keep track of the number of lines read, compare the two lines you just read and if they're different, display a message saying what the current line number is.
Dim file1 As StreamReader("Filename1.txt")
Dim file2 As StreamReader("Filename2.txt")
Dim line1, line2 As String
Dim lineNumber As Integer

While (file1.Peek() >= 0) Or (file2.Peek() >= 0)
    line1 = file1.ReadLine()
    line2 = file2.ReadLine()
    lineNumber += 1
    ' If the first ReadLine returned a string...
    '   AndAlso the second ReadLine returned a string...
    '   AndAlso both strings are equal...
    If (Not line1 Is Nothing) AndAlso (Not line2 Is Nothing) AndAlso (String.Compare(line1, line2, True) <> 0) Then
        ' Both strings were equal!!
    Else
        ' Both files were NOT equal at this line!
        Console.WriteLine("File difference at line " & lineNumber.ToString() )
    End If
End While
file1.Close()
file2.Close()



RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: Compare 2 different data file Pin
sumiko23-Aug-04 18:12
sumiko23-Aug-04 18:12 
GeneralRe: Compare 2 different data file Pin
Dave Kreskowiak24-Aug-04 0:21
mveDave Kreskowiak24-Aug-04 0:21 
GeneralRe: Compare 2 different data file Pin
sumiko31-Aug-04 20:40
sumiko31-Aug-04 20:40 
GeneralExporting RGN to Files Pin
zman90018-Aug-04 18:28
zman90018-Aug-04 18:28 
GeneralRe: Exporting RGN to Files Pin
Dave Kreskowiak19-Aug-04 3:02
mveDave Kreskowiak19-Aug-04 3:02 
GeneralRe: Exporting RGN to Files Pin
zman90019-Aug-04 17:21
zman90019-Aug-04 17:21 
GeneralRe: Exporting RGN to Files Pin
Dave Kreskowiak20-Aug-04 3:28
mveDave Kreskowiak20-Aug-04 3:28 
GeneralRe: Exporting RGN to Files Pin
zman90021-Aug-04 16:37
zman90021-Aug-04 16:37 
GeneralBinding Array of Structures to Datagrid Pin
Gary Shel18-Aug-04 12:16
Gary Shel18-Aug-04 12:16 
GeneralListview selected row Pin
Tartampion18-Aug-04 10:52
Tartampion18-Aug-04 10:52 
GeneralRe: Listview selected row Pin
progload18-Aug-04 11:53
progload18-Aug-04 11:53 
GeneralRe: Listview selected row Pin
Tartampion19-Aug-04 2:26
Tartampion19-Aug-04 2:26 
GeneralSmart client Pin
Marcus Travaglia18-Aug-04 8:32
sussMarcus Travaglia18-Aug-04 8:32 
GeneralValidating a XML against a DTD Pin
XGaMeS18-Aug-04 8:23
XGaMeS18-Aug-04 8:23 
GeneralSocket problem Pin
XGaMeS18-Aug-04 4:25
XGaMeS18-Aug-04 4:25 
GeneralPLS HELP!! Pin
Lisana18-Aug-04 3:35
Lisana18-Aug-04 3:35 
GeneralRe: PLS HELP!! Pin
Dave Kreskowiak18-Aug-04 4:17
mveDave Kreskowiak18-Aug-04 4:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.