I am just writing a simple file browser. It works without problems when i point to a specific directory but throws "UnauthorizedAccessException access to the path .... is denied" when i point to drive "C:\\" or "D:\\" appreciate any help.
If Not txtToSearch.Text = Nothing Then
ListBox1.Items.Clear()
FC = 0
For Each foundfile As String In My.Computer.FileSystem.GetFiles("D:\\", FileIO.SearchOption.SearchAllSubDirectories, Nothing)
Dim title As String = My.Computer.FileSystem.GetFileInfo(foundfile).Name
If title.Contains(txtToSearch.Text) Then
ListBox1.Items.Add(title)
FC += 1
End If
Next