vi posto tutto il codice
FUNZIONE SUBSTRING PER RICAVARE SOLO I CARATTERI E STRINGHE DATE DAL FILE TXT SELEZIONATO
codice:
Public Function CheckStringa(ByVal tmp As String) As String
Dim s As String = ""
If tmp.Length > 0 Then
If tmp.Chars(0) = "-"c And tmp.Chars(1) = "-"c And tmp.Chars(tmp.Length - 1) = "-"c Then
s = tmp.Substring(3, tmp.Length - 30)
End If
End If
Return s
End Function
ALL' EVENTO CLICK DEL BUTTON APRI... , SELEZIONO ED APRO IL FILE
codice:
'APRO IL FILE .TXT
Dim str As String = ""
'procedi con l'estrazione
Using miofile As New System.IO.StreamReader(OpenFile.FileName)
Do Until miofile.EndOfStream
str = CheckStringa(miofile.ReadLine)
If Not str = "" Then
lstData.Items.Add(str)
End If
Loop
End Using
IN lstData.Items.Add(str) MI APPAIONO PERO' DATE UGUALI....OVVIAMENTE