Now I am having troubles deleting duplicate lines for some reason.
I got this code for erasing duplicate lines, but it isn't working when I try modifying it for this application:
vb.net Code:
Dim Lines As New ArrayList 'put all the lines of the textfile into the arraylist Lines.AddRange(IO.File.ReadAllLines("C:\dns.txt")) 'loop the arraylist in reverse because the IndexOf searches top to bottom For i As Integer = Lines.Count - 1 To 0 Step -1 'if the return index is smaller than the index of the line we are 'searching for then we can remove that line because there is a duplicate If Lines.IndexOf(Lines(i)) < i Then Lines.RemoveAt(i) End If Next








Reply With Quote