L
li_lzp
Unregistered / Unconfirmed
GUEST, unregistred user!
以下為查找filedata目錄下日所有文件與目錄:
代碼如下:
function GetFile(FileData,Socket:TCUSTOMWINSOCKET):boolean;
var
rs:TSEARCHRESC;
H:INTEGER;
comlist:TSTRINGLIST;
s:string;
BEGIN
comlist:=TSTRINGLIST.CREATE;
h:=findfirst(FILEDATA,fmanyfile,rs);
if h=0 then
begin
repeat
s:=rs.filename;
comlist.add(s);
until findnext(rs) <> 0
closefind(rs);
comlist.free;
socket.sendtext(comlist.text);
result:=true;
end
else
begin
showmessage(inttostr(getlasterror()));
result:=false;
end;
END;
結果返回值=2;請高手指明道路,同時用WINDOWS API 函數FINDFIRSTFILE,FINDNEXTFILE,
FINDCLOSE結果也是一樣
代碼如下:
function GetFile(FileData,Socket:TCUSTOMWINSOCKET):boolean;
var
rs:TSEARCHRESC;
H:INTEGER;
comlist:TSTRINGLIST;
s:string;
BEGIN
comlist:=TSTRINGLIST.CREATE;
h:=findfirst(FILEDATA,fmanyfile,rs);
if h=0 then
begin
repeat
s:=rs.filename;
comlist.add(s);
until findnext(rs) <> 0
closefind(rs);
comlist.free;
socket.sendtext(comlist.text);
result:=true;
end
else
begin
showmessage(inttostr(getlasterror()));
result:=false;
end;
END;
結果返回值=2;請高手指明道路,同時用WINDOWS API 函數FINDFIRSTFILE,FINDNEXTFILE,
FINDCLOSE結果也是一樣