先用InternetCheckConnection判断下
uses wininet;
if not InternetCheckConnection(pchar(edit1.text), 1, 0) then
showmessage('无法打开页面 ');
uses wininet;
if not InternetCheckConnection(pchar(edit1.text), 1, 0) then
showmessage('无法打开页面 ');