uses WinInet; procedure TForm1.Button1Click(Sender: TObject); begin if InternetGetConnectedState(nil, 0) then ShowMessage('已连接'); end;