找回密码
 加入
搜索
查看: 2121|回复: 3

怎样获取文件夹名称,在线等!!!

[复制链接]
发表于 2009-4-27 11:06:01 | 显示全部楼层 |阅读模式
我要获取D盘跟目录所有文件夹名和文件名,输出到一个txt文本中.批处理很简单,但是我修要用AU3写个程序,请问用AU3该怎么弄,重要的"获取D盘跟目录所有文件夹名和文件名",AU3里有没有这样的函数哇,急死了
发表于 2009-4-27 13:31:45 | 显示全部楼层
用户自定义函数里有
_FileListToArray
发表于 2009-4-27 14:11:55 | 显示全部楼层
_FileListToArray
Lists files and\or folders in a specified path (Similar to using Dir with the /B Switch)

#Include <File.au3>
_FileListToArray($sPath[, $sFilter = "*"[, $iFlag = 0]])


参数
$sPathPath to generate filelist for.
$sFilterOptional the filter to use, default is *. Search the Autoit3 helpfile for the word "WildCards" For details.
$iFlagOptional: specifies whether to return files folders or both
$iFlag=0(Default) Return both files and folders
$iFlag=1 Return files only
$iFlag=2 Return Folders only


返回值
@Error: 1 = Path not found or invalid
        2 = Invalid $sFilter
        3 = Invalid $iFlag
        4 = No File(s) Found


注意
The array returned is one-dimensional and is made up as follows:
$array[0] = Number of Files\Folders returned
$array[1] = 1st File\Folder
$array[2] = 2nd File\Folder
$array[3] = 3rd File\Folder
$array[n] = nth File\Folder

#Include <File.au3>
#Include <Array.au3>
$FileList=_FileListToArray(@DesktopDir)
If @Error=1 Then
MsgBox (0,"","No Files\Folders Found.")
Exit
EndIf
_ArrayDisplay($FileList,"$FileList")
 楼主| 发表于 2009-4-28 09:01:46 | 显示全部楼层
谢谢咯.可惜我的E文不太好
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-15 03:50 , Processed in 0.106757 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表