PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 2ms 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/////////////////////////////////////////////////////////////////////////////
 6Use:
 7
 8The VBListFilesInDirectory project demonstrates how to implement an 
 9IEnumerable(Of String) that utilizes the Win32 File Management functions to 
10enable application to get files and sub-directories in a specified directory
11one item a time.
12
13The FileEnumerator class in this sample project solved a common problem in
14the System.IO.Directory.GetFiles method - if a directory contains a large
15number of items, this it will take a long time for this method to return
16because it will enumerate all the files and put the names in an array as
17an entire operation. This will also cause a very high memory load if the
18array gets huge.
19
20The FileEnumerator class works differently. It returns one file at a time.
21And the enumeration can be canceled or reset at anytime.
22
23
24/////////////////////////////////////////////////////////////////////////////
25References:
26
27FindFirstFile Function
28http://msdn.microsoft.com/en-us/library/aa364418(VS.85).aspx
29
30FindNextFile Function
31http://msdn.microsoft.com/en-us/library/aa364428(VS.85).aspx
32
33FindClose Function
34http://msdn.microsoft.com/en-us/library/aa364413(VS.85).aspx
35
36IEnumerable(Of T) Interface
37http://msdn.microsoft.com/en-us/library/9eekhta0.aspx
38
39IEnumerator(Of T) Interface
40http://msdn.microsoft.com/en-us/library/78dfe2yb.aspx
41
42
43/////////////////////////////////////////////////////////////////////////////