k..i got a listview i need to load a text file into it.....
text file looks like this...
Username1
Password1
Username2
Password2
i got my save to file sub lookin like this...
now i need to know how to read the file line by line....then i want to add the usernames as an item with the password as the first subitem....Code:Private Sub SaveList() Dim sTemp As String = Application.StartupPath.ToString & "\idlist.txt" Dim sTemp1 As String ' Loop through and save all items in list. If (LV_IDList.Items.Count > 0) Then Try Dim i As Integer ' Create a StreamWriter object to write to the file. Dim writer As New IO.StreamWriter(sTemp, False) ' Write the information to the file one line at a time. i = 0 Do If i < LV_IDList.Items.Count Then sTemp1 = LV_IDList.Items(i).Text & vbNewLine & LV_IDList.Items(i).SubItems(1).Text writer.WriteLine(sTemp1) i = i + 1 Else Exit Do End If Loop ' Close the StreamWriter object. writer.Close() Catch End Try End If End Sub
thx in advance
AcE




Reply With Quote