PDA

View Full Version : what am I doing wrong ?


ButtonMaker
12-27-2008, 09:25 AM
I want to list all the files in "Temporary Internet Files" folder to listbox but it doesnt work !!!

On Global :
function FolderToListbox(strObject,strFolder,bRecurse,tbFil ters)
for index, strExt in tbFilters do
tbFile = File.Find(strFolder, strExt, bRecurse, false, nil, nil);
if tbFile then
for index, strPath in tbFile do
local sPath= String.SplitPath(strPath);
ListBox.AddItem(strObject, sPath.Filename, strPath);
end
end
end
end

On Show :
FolderToListbox("ListBox1", "C:\Documents and Settings\Button Maker\Local Settings\Temporary Internet Files", false, {"",""})

WebCyb
12-27-2008, 12:37 PM
Try with this ;)

On Show :
FolderToListbox("ListBox1", "C:\\Documents and Settings\\Button Maker\\Local Settings\\Temporary Internet Files", false, {"",""})

GoOgLe
12-28-2008, 03:15 AM
no it didnt work !!! it doesnt fill the listbox...

ButtonMaker
12-28-2008, 03:37 AM
yes for me too... :rolleyes

jackdaniels
12-28-2008, 04:31 AM
try like that...

Files = File.Find("C:\\Documents and Settings\\Button Maker\\Local Settings\\Temporary Internet Files", "*.*", true, false, ShowSearchProgress, nil);
if Files then
ListBox.DeleteItem("ListBox1", LB_ALLITEMS)
for i,v in Files do
tbSplit = String.SplitPath(v);
ListBox.AddItem("ListBox1", tbSplit.Filename, v);
end
end

ButtonMaker
12-28-2008, 04:45 AM
thanks alot jackdaniels...

is it possible to make it with progress bar because it takes time to load ???

RizlaUK
12-28-2008, 08:21 AM
use a callback in the File.Find function