A
abc123123
Unregistered / Unconfirmed
GUEST, unregistred user!
在执行循环的时候,有可能网络断了或网站服务器打不开而报错,会弹出确认窗口,我现在想不要弹出确认窗口,而是直接退出程序,请问这代码要怎么写呢(或者说应该是用哪个异常事件呢?)?谢谢
var
i:integer;
html,judgeword:string;
begin
judgeword:='proxy';
for i:=0 to memo1.lines.count-1 do
begin
html:=idhttp1.get('http://www.website.com/index.php?tid='+memo1.lines.strings);//取得指定网页的源代码
sleep(300);
if pos(judgeword,html)>0 then //如果存在yes
AppendFile(ExtractFilePath(Application.ExeName)+'Yes.txt',memo1.lines.strings) //存入yes.txt文档
else
AppendFile(ExtractFilePath(Application.ExeName)+'No.txt',memo1.lines.strings); //存入no.txt文档
end;
halt(0);
end;
var
i:integer;
html,judgeword:string;
begin
judgeword:='proxy';
for i:=0 to memo1.lines.count-1 do
begin
html:=idhttp1.get('http://www.website.com/index.php?tid='+memo1.lines.strings);//取得指定网页的源代码
sleep(300);
if pos(judgeword,html)>0 then //如果存在yes
AppendFile(ExtractFilePath(Application.ExeName)+'Yes.txt',memo1.lines.strings) //存入yes.txt文档
else
AppendFile(ExtractFilePath(Application.ExeName)+'No.txt',memo1.lines.strings); //存入no.txt文档
end;
halt(0);
end;