PageRenderTime 161ms CodeModel.GetById 25ms RepoModel.GetById 15ms app.codeStats 0ms

/Visual Studio 2008/VBListFilesInDirectory/ReadMe.txt

#
Plain Text | 43 lines | 30 code | 13 blank | 0 comment | 0 complexity | 9ff9e8e86b15dc5bcd3f9c3400f611e4 MD5 | raw file
  1. ========================================================================
  2. WINDOWS FORMS APPLICATION : VBListFilesInDirectory Project Overview
  3. ========================================================================
  4. /////////////////////////////////////////////////////////////////////////////
  5. Use:
  6. The VBListFilesInDirectory project demonstrates how to implement an
  7. IEnumerable(Of String) that utilizes the Win32 File Management functions to
  8. enable application to get files and sub-directories in a specified directory
  9. one item a time.
  10. The FileEnumerator class in this sample project solved a common problem in
  11. the System.IO.Directory.GetFiles method - if a directory contains a large
  12. number of items, this it will take a long time for this method to return
  13. because it will enumerate all the files and put the names in an array as
  14. an entire operation. This will also cause a very high memory load if the
  15. array gets huge.
  16. The FileEnumerator class works differently. It returns one file at a time.
  17. And the enumeration can be canceled or reset at anytime.
  18. /////////////////////////////////////////////////////////////////////////////
  19. References:
  20. FindFirstFile Function
  21. http://msdn.microsoft.com/en-us/library/aa364418(VS.85).aspx
  22. FindNextFile Function
  23. http://msdn.microsoft.com/en-us/library/aa364428(VS.85).aspx
  24. FindClose Function
  25. http://msdn.microsoft.com/en-us/library/aa364413(VS.85).aspx
  26. IEnumerable(Of T) Interface
  27. http://msdn.microsoft.com/en-us/library/9eekhta0.aspx
  28. IEnumerator(Of T) Interface
  29. http://msdn.microsoft.com/en-us/library/78dfe2yb.aspx
  30. /////////////////////////////////////////////////////////////////////////////