我想用如下程序来判断远程计算机是否在网上,
try 
idicmpclient1.host:='192.168.1.202';
idicmpclient1.ping;
if idicmpclient1.replystatus.fromipaddress:='192.168.1.202' then 
showmessage('远程计算机在网上。');
except 
showemessage('远程计算机不在网上.');
end;
但即使远程计算机不在网上,except也截获不了错误信息,不知其所以然,望各位专家指点。
       谢谢!
                                       丁丁
                                  2003.07.05

解决方案 »

  1.   

    try 
    idicmpclient1.host:='192.168.1.202';
    idicmpclient1.ping;
    if idicmpclient1.replystatus.fromipaddress='192.168.1.202' then 
      showmessage('远程计算机在网上。')
    else
      showemessage('远程计算机不在网上.');except 
    showemessage('远程计算机不在网上.');
    end;试试
      

  2.   

    不行,用shao666先生的例子except还是截获不了错误信息。
                   丁丁
                            2003.07.05
      

  3.   

    你是不是在delphi的调试环境下测试的,如果是请从外部运行编译好的文件
      

  4.   

    如果是发生异常后不再执行代码的话,从“Tools”菜单中选中"Debugger Options..."
    再选中"Language Exceptions",把"Stop On Delphi Exceptions"前的钩去掉。