我在這裏VB.NET使這個小文件搜索引擎:) ListBox1.Items.Clear() ListBox3.Items.Clear(拒絕訪問路徑 - Vb.Net
ChDir("C:\")
Try
For Each foundFile As String In My.Computer.FileSystem.GetFiles(_
My.Computer.FileSystem.CurrentDirectory, _
FileIO.SearchOption.SearchAllSubDirectories, TextBox4.Text & "*.*")
ListBox1.Items.Add(foundFile)
ListBox3.Items.Add(foundFile)
Next
Catch ex As UnauthorizedAccessException
MsgBox("Could not access file or not enough priveledges")
End Try
它搜索通過你輸入的文件整個C:\。雖然我得到的問題是某些目錄訪問被拒絕或不存在的目錄。我該如何解決這個問題?
感謝
一般來說,你不應該需要訪問這些目錄,只是你知道。 – Cyclone 2009-11-21 21:50:16
我該怎麼做? – lab12 2009-11-21 22:13:59
我加入了一些示例代碼。用你自己的代碼替換評論當然。 – Cyclone 2009-11-22 03:04:00