jhylands

'finds the files in the current directory

Jan 12th, 2012
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.74 KB | None | 0 0
  1. 'finds the files in the current directory
  2. Dim files() As String = IO.Directory.GetFiles(dir_curr)
  3. Dim f_runtime As Integer = 0
  4. 'finds the sub directories in the current directory
  5. Dim dirs() As String = IO.Directory.GetDirectories(dir_curr)
  6. 'prevents the program from cutting off bits of the paths
  7. Dim cut_no As Integer = 2
  8. If Len(dir_curr) = 3 Then
  9. cut_no = 1
  10. End If
  11. 'writes all the sub directories
  12. For f_runtime = 0 To dirs.Length - 1
  13. Console.WriteLine("DIR :: " & Mid$(dirs(f_runtime)(Len(dir_curr)+cut_no),dirs(f_runtime).Length))
  14. Next f_runtime
  15. f_runtime = 0
  16. 'writes all of the files
  17. For f_runtime = 0 To files.Length - 1
  18. Console.WriteLine(" " & Mid$(files(f_runtime), (Len(dir_curr) + cut_no), files(f_runtime).Length))
  19. Next f_runtime
Advertisement
Add Comment
Please, Sign In to add comment