K
kingswww
Unregistered / Unconfirmed
GUEST, unregistred user!
刚接触delphi下面是我找到的代码 判断是不是找到指定网址, 但是如何判断多个网址,比如我要知道当前访问的网址是不是,www.delphibbs.com www.baidu.com www.hao123.com 该如何写unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,ddeman, ExtCtrls;type TForm1 = class(TForm) Button1: TButton;
Memo1: TMemo;
Edit1: TEdit;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
private { Private declarations } public { Public declarations } end;
var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Timer1Timer(Sender: TObject);
var dde:tddeclientconv;
j:integer;
begin
memo1.Text:='';
sleep(50);
dde := tddeclientconv.create(self);
if dde.setlink('Iexplore','WWW_GetWindowInfo') then
begin
memo1.Text:=memo1.Text+dde.requestdata('0xffffffff,sURL,sTitle');
j:=pos('http://www.hao123.com',memo1.Text);
if j<>0 then
showmessage('找到');
end else
showmessage('没有找到');
end;
end.
Memo1: TMemo;
Edit1: TEdit;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
private { Private declarations } public { Public declarations } end;
var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Timer1Timer(Sender: TObject);
var dde:tddeclientconv;
j:integer;
begin
memo1.Text:='';
sleep(50);
dde := tddeclientconv.create(self);
if dde.setlink('Iexplore','WWW_GetWindowInfo') then
begin
memo1.Text:=memo1.Text+dde.requestdata('0xffffffff,sURL,sTitle');
j:=pos('http://www.hao123.com',memo1.Text);
if j<>0 then
showmessage('找到');
end else
showmessage('没有找到');
end;
end.