怎样将某目录下的所以文件的文件名(是否有文件和文件数未知)放到某数组中

zengguochao1980 2003-11-28 04:42:00
怎样将某目录下的所以文件的文件名(是否有文件和文件数未知)放到某数组中
...全文
41 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
klbt 2003-11-28
  • 打赏
  • 举报
回复
lb_1.DirList('f:\*.mdb', 16384)
lmby 2003-11-28
  • 打赏
  • 举报
回复
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 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 ?System files?16 ?Subdirectories?32 ?Archive (modified) files?16384 ?Drives?32768 ?Exclude read/write files from the listTo list several types, add the numbers associated with the types. For example, to list read-write files, 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

仔细看看帮助。
zengguochao1980 2003-11-28
  • 打赏
  • 举报
回复
为什么

lb_1.DirList('*.mdb', 16400,'f:\') 编译通不过?
flyerlxg 2003-11-28
  • 打赏
  • 举报
回复
Syntax

listboxname.DirList ( filespec, filetype {, statictext } )

Argument 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 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 ?System files?16 ?Subdirectories?32 ?Archive (modified) files?16384 ?Drives?32768 ?Exclude read/write files from the listTo list several types, add the numbers associated with the types. For example, to list read-write files, 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
Return value

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 could not be populated (for example, filespec was a file, not a directory, or specified an invalid path). If any argument's value is NULL, DirList returns NULL.
chrisfy 2003-11-28
  • 打赏
  • 举报
回复
lb_1.dirList(ls_path,0 + 1 + 2 + 4 + 32 + 32768)
intuition444 2003-11-28
  • 打赏
  • 举报
回复
UP,然后对ddlb_1,取item 就可以了.listbox控件也可以.用的时候,注意将visible=false
mittee 2003-11-28
  • 打赏
  • 举报
回复
ddlb_1.dirlist() 可以取得文件名

1,108

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧