hey guys
can u help me with this the problem of this code should delete only the selected item from the listview in a report.txt but this code delete all the data in the txt file whether i selected only one data from the listview....
Dim myFile As String = "C:\report.txt"
Dim stream As New IO.FileStream(myFile, IO.FileMode.Create)
Dim writer As New IO.StreamWriter(stream)
For Each item As ListViewItem In ListView1.SelectedItems
item.Remove()
MsgBox("File Deleted Permanently.", MsgBoxStyle.Information)
Next
Next
writer.Flush()
writer.Close()
stream.Close()