procedure TForm1.Button1Click(Sender: TObject);
begin
if GetSystemMetrics(SM_NETWORK) AND $01 = $01 then
ShowMessage('Machine is attached to network') else
ShowMessage('Machine is not attached to network');
end;
begin
if GetSystemMetrics(SM_NETWORK) AND $01 = $01 then
ShowMessage('Machine is attached to network') else
ShowMessage('Machine is not attached to network');
end;
begin
if InternetCheckConnection('http://www.yahoo.com/', 1, 0) then
edit1.text:= 'Connected'
else
edit1.text:= 'Disconnected';
end;
那就是调用dos下面的ping 和tracert
winexec(pchar('command.com /c ping '+host),sw_show);
winexec(pchar('command.com /c tracert '+host),sw_show);
另外你也可以把得到的内容显示在你自己的程序里面
那就是调用dos下面的ping 和tracert
winexec(pchar('command.com /c ping '+host),sw_show);
winexec(pchar('command.com /c tracert '+host),sw_show);
另外你也可以把得到的内容显示在你自己的程序里面
这篇文章比较经典
建议你去看看