I put this subin an webapplication project and it works OK, but in a windowsapplication project it generates an error "an unhandled exception of type system.security.securityexception"
VB Code:
Private Sub SearchDir(ByVal TargetDir As String) Dim Files() As String Dim File As String Files = IO.Directory.GetFiles(TargetDir, "*.*") lstFiles.Items.Clear() For Each File In Files lstFiles.Items.Add(File) Next End Sub
Why?
