how to use filesystemobject to list a directory structure ?(50分)

  • 主题发起人 主题发起人 yuanlehong
  • 开始时间 开始时间
Y

yuanlehong

Unregistered / Unconfirmed
GUEST, unregistred user!
I want to write a application which will list the entire directory , i use the following code:

var fso:variant;
thefolder:variant;
thefiles:variant;
thefilecounter:integer;
i:integer;
begin
fso:=createoleobject('scripting.filesystemobject');
thefolder:=fso.getfolder('c:/temp');
thefilecounter=thefolder.files.count;
showmessage(inttostr(thefilecounter));
for i:=0 to thefilecounter-1 do
listbox1.items.add(thefolder.files.name);
// listbox1.items.add(thefolder.files.item);
end;

all code run success but "listbox1.items.add(thefolder.files.name)" and "listbox1.items.add(thefoler.files.item"
Can you tell me what happen with the set "thefolder.files" and how can i do it?


 
请继续或结束
 
win3.1中有这样的控件,不用这么麻烦。
 
接受答案了.
 
后退
顶部