I guys! 'm tring to search specific file(xlsx) into my document folder, but i get error about permission.I set the vb.net ication as Administrator
Thanks for any help!
My code:
Dim FolderPath As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
Dim directory = FolderPath
Dim files() As System.IO.FileInfo
Dim dirinfo As New System.IO.DirectoryInfo(directory)
files = dirinfo.GetFiles("xlsx", IO.SearchOption.AllDirectories) error line:
Eccezione non gestita di tipo 'System.UnauthorizedAccessException' in mscorlib.dll
For Each file In files
ListBox1.Items.Add(file)
Next
End Sub