Click here to Skip to main content
15,902,837 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
i want to compare two text file form 2 textbox and i success to compare it but problem that i face now is unable to highlight the different of two text file...

ps : i extended CKEditor to use as my textbox

Below is my coding for compare 2 text file

VB
Protected Sub btnCompare_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCompare.Click
    Dim txt1(CKEditor1.Text.Split(" ").Length) As String
    Dim txt2(CKEditor2.Text.Split(" ").Length) As String

    txt1 = CKEditor1.Text.Split(" ")
    txt2 = CKEditor2.Text.Split(" ")
    If txt2.Length <> txt1.Length Then
        lblMessage.Visible = True
        lblMessage.Text = "Please Insert Same Type File"
    Else
        Dim same As String = ""

        For i = 0 To txt2.Length - 1

            If txt2(i) <> txt1(i) Then
                same += txt1(i) & "(" & txt2(i) & ") "

            Else

                txt2(i) = txt1(i)
                same += txt1(i).ToString & " "

            End If

        Next i

        CKEditor3.Text = same.ToString

    End If


End Sub



is that any idea how to do this?

Thx
Posted
Updated 28-May-15 23:01pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900