L
like_ask
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TQueryThread.Execute;
var
p:integer;
Linkbuf:string;
va,ev,ename:string;
i,m,f :integer;
source:string;
be,en:integer;
begin
try
{IF ttmemo=nil then
ttmemo:=Tstrings.Create
else
ttmemo.Clear;
}
m:=333;
for f:=0 to mdo
begin
Htm:= getwebpage(mainfrm.tempurl+fuserid+mainfrm.tempurla+inttostr(f)+mainfrm.tempurlc);
Delete(htm,1,pos('saf d',htm));
Mainfrm.Statusbar1.Panels[2].Text:='当前第: '+inttostr(f)+' 页';
for i:=0 to StrCounter(htm,va)do
begin
P:=Pos(Va,Htm);
If p>0 then
Delete(Htm,1,P+Length(va)-1) else
Exit;
Linkbuf:=copy(Htm,0,32);
Delete(Htm,1,32+length(ev));
Ename:= copy(htm,1,pos('</a>',htm)-1);
Delete(Htm,1,4);
If pos(Linkbuf,mainfrm.memo2.Text)=0 then
begin
If Mainfrm.CheckBox1.Checked then
begin
If Pos(trim(mainfrm.ComboBox1.text),GetWebPage(va+Linkbuf))>0 then
mainfrm.memo2.lines.Add(Linkbuf+' | '+Ename+' | '+Mainfrm.ComboBox1.Text);
End
else
begin
mainfrm.memo2.lines.Add(Linkbuf+' | '+Ename);
end;
synchronize(addtottmemo);//
end;
end;
end;
except
end;
//ttmemo.Free;
end;
在这其中循环只能执行一次,麻烦大家指点一下。
var
p:integer;
Linkbuf:string;
va,ev,ename:string;
i,m,f :integer;
source:string;
be,en:integer;
begin
try
{IF ttmemo=nil then
ttmemo:=Tstrings.Create
else
ttmemo.Clear;
}
m:=333;
for f:=0 to mdo
begin
Htm:= getwebpage(mainfrm.tempurl+fuserid+mainfrm.tempurla+inttostr(f)+mainfrm.tempurlc);
Delete(htm,1,pos('saf d',htm));
Mainfrm.Statusbar1.Panels[2].Text:='当前第: '+inttostr(f)+' 页';
for i:=0 to StrCounter(htm,va)do
begin
P:=Pos(Va,Htm);
If p>0 then
Delete(Htm,1,P+Length(va)-1) else
Exit;
Linkbuf:=copy(Htm,0,32);
Delete(Htm,1,32+length(ev));
Ename:= copy(htm,1,pos('</a>',htm)-1);
Delete(Htm,1,4);
If pos(Linkbuf,mainfrm.memo2.Text)=0 then
begin
If Mainfrm.CheckBox1.Checked then
begin
If Pos(trim(mainfrm.ComboBox1.text),GetWebPage(va+Linkbuf))>0 then
mainfrm.memo2.lines.Add(Linkbuf+' | '+Ename+' | '+Mainfrm.ComboBox1.Text);
End
else
begin
mainfrm.memo2.lines.Add(Linkbuf+' | '+Ename);
end;
synchronize(addtottmemo);//
end;
end;
end;
except
end;
//ttmemo.Free;
end;
在这其中循环只能执行一次,麻烦大家指点一下。