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?
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?