r,e:TRegExpr;
link:string;
begin
idp.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; TheWorld)';
memo1.Text:=idp.Get(trim(edit1.text));
r:=TRegExpr.Create;
e:=TRegExpr.Create;
if not connDB then showmessage('数据库链接失败!');
if r.Exec (memo1.text) then begin
repeat
if pos('http',r.Match[0])=0 then
link:=trim(edit1.text)+'/'+r.Match[0]
else
if pos('https',r.Match[0])=0 then
link:=r.Match[0]
else
r.ExecNext;
link:=stringreplace(link,'//','/',[rfreplaceall]);
if pos('http://',link)=0 then
link:=stringreplace(link,'http:/','http://',[rfreplaceall]);
memo2.Lines.Add(link);
with dm.query do begin
Close;
sql.Clear;
sql.Add('select * from linkList where link='+quotedstr(link));
open;
if recordcount=0 then begin
Append;
FieldByName('link').value:=link;
FieldByName('addTime').value:=now();
FieldByName('lKeyId').value:='0';
post;
end;
end;
until not r.ExecNext;
end;
r.Expression:='[_a-zA-Z\d\-\.]+@[_a-zA-Z\d\-]+(\.[_a-zA-Z\d\-]+)+';
with dm.query do begin
close;
sql.Clear;
sql.Add('select lid,link from linkList where sendTime is null');
open;
showmessage(fieldbyname('link').asstring);
while not eof do begin
try
if r.Exec(idp.Get(trim(fieldbyname('link').AsString))) then begin
with Tadoquery.create(nil) do begin
connection:=dm.conn;
repeat;
Close;
sql.Clear;
sql.Add('select * from linkList where link='+quotedstr(link));
open;
if recordcount=0 then begin
Append;
FieldByName('link').value:=link;
FieldByName('addTime').value:=now();
FieldByName('lKeyId').value:='0';
post;
end;
until not r.ExecNext;
free;
end;
end else begin
//link:='delete from linkList where lid='+fe;
end;
except
r.ExecNext;
end;
end;
end;
r.free;
end;
procedure TEmail.CheckBox6Click(Sender: TObject);
begin
showmessage('因为google经常给墙,所以不建议使用,用yahoo!');
end;