Home > database >  List all files under the specified directory
List all files under the specified directory

Time:10-12

Specified directory or drive out all of the following documents and all documents folder, surf the Internet to find a example, but the result is only one level, did not even list file, have superior do give directions or give a example
This is the case, the feeling is right, but the output does have some problems, has a problem I debug?
http://blog.csdn.net/itwenping/article/details/5679628
Email [email protected]

CodePudding user response:

My idea is listed in the catalogue style
C: \ ab. TXT
C.w Windows \ 123. TXT
C: \ Windows \ system32\123. TXT
C: \ Windows \ system32 \ ABC \ 123. TXT

CodePudding user response:

The key code:
SDirList="C: \ *. *"
Ddlb_file. Dirlist (sDirList, 1)
SFile=ddlb_file. Text
If sFile is a directory, you should take it again this file and directory in the directory,
The iterative operation,

CodePudding user response:

refer to the second floor r00_a2lBUR response:
key code:
SDirList="C: \ *. *"
Ddlb_file. Dirlist (sDirList, 1)
SFile=ddlb_file. Text
If sFile is a directory, you should take it again this file and directory in the directory,
Iterative operation,


Yes, I have done,,

CodePudding user response:

refer to the second floor r00_a2lBUR response:
key code:
SDirList="C: \ *. *"
Ddlb_file. Dirlist (sDirList, 1)
SFile=ddlb_file. Text
If sFile is a directory, you should take it again this file and directory in the directory,
Iterative operation,

Example to have excuse me? I understand about using dirlist, dirlist [] is a directory, judge the [] to continue to go in, but if there is a level 3 or level 4 and multi-level directory? I don't know much about the Internet to use recursion or something, but small white sincerely no research to understand

CodePudding user response:

reference 4 floor zlt_wangyan response:
Quote: refer to the second floor r00_a2lBUR response:

The key code:
SDirList="C: \ *. *"
Ddlb_file. Dirlist (sDirList, 1)
SFile=ddlb_file. Text
If sFile is a directory, you should take it again this file and directory in the directory,
Iterative operation,

Example to have excuse me? I understand about using dirlist, dirlist [] is a directory, judge the [] to continue to go in, but if there is a level 3 or level 4 and multi-level directory? I don't know much about online to use recursion or something, but small white sincerely no research understand
I didn't do this, 3 # have done,

CodePudding user response:

reference hovoy reply: 3/f
Quote: refer to the second floor r00_a2lBUR response:

The key code:
SDirList="C: \ *. *"
Ddlb_file. Dirlist (sDirList, 1)
SFile=ddlb_file. Text
If sFile is a directory, you should take it again this file and directory in the directory,
Iterative operation,


Yes, I have done,,

, small new mine hand, for the still don't quite understand, can you give an example for me to study it,

CodePudding user response:

refer to 6th floor zlt_wangyan response:
Quote: refer to the third floor hovoy response:

Quote: refer to the second floor r00_a2lBUR response:

The key code:
SDirList="C: \ *. *"
Ddlb_file. Dirlist (sDirList, 1)
SFile=ddlb_file. Text
If sFile is a directory, you should take it again this file and directory in the directory,
Iterative operation,


Yes, I have done,,

, small new mine hand, for the still don't quite understand, can you give an example for me to study,


Look at pb bring help, there is a brief example, I copied a give you,

DirList PowerScript function
The Description
Populates a ListBox with a list of files. You can specify a path, a mask, and a file type to restrict the set of files displayed. If the window has an associated StaticText control, DirList can display the current drive and directory as well.

Controls,
ListBox, DropDownListBox PictureListBox, and DropDownPictureListBox controls,

Syntax
Listboxname. DirList (filespec, filetype statictext}, {) Argument
The Description

Listboxname
The name of The ListBox control you want to populate.

Filespec
A string whose value is the file pattern. This is usually A mask (for example, *. INI the or *. TXT). If you include A path, it becomes the current drive and directory.

Filetype
An unsigned integer representing one or more types of files you want to list in the ListBox. Types are:

0 - Read/write files

1 - Read - only files

2 - Hidden files

4, the System files

16 - Subdirectories

32 - Archive files (modified)

16384 - Drives

32768 - Exclude the read/write files from the list

To list several types, and add the Numbers associated with the types, For example, To list the read - write files and subdirectories, and drives, use 0 + 16 + 16384 or 16400 For filetype.

Statictext (optional)
The name of The StaticText in which you want to display The current drive and directory.


The Return Values
Boolean. Returns true if the search path is valid so that the ListBox is populated or the list is empty, DirList Returns false if the ListBox always be populated (for example, filespec is a file, not a directory, or specifies an invalid path). If any argument 's value is null, DirList Returns null.

The Usage
You can call DirList the when the window opens to populate the list initially. You should also call DirList in the script for the SelectionChanged event to repopulate the list box -based on the new selection. (See the example in DirSelect.)

Note Alternatives
nullnullnullnullnullnullnullnullnullnullnull
  • Related