I used following vb code to search files of the windows. But during the search process the program is not responding and even it cannot move. Why this happened ? and how to solve the problem ?.
HTML:
Public Class Form1
Dim list As Windows.Forms.ListViewItem
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
For Each file In My.Computer.FileSystem.GetFiles("C:\", FileIO.SearchOption.SearchAllSubDirectories)
list = ListView1.Items.Add(file)
Next
End Sub
End Class