Советы по Delphi

         

Как можно определить, что компьютер подключен к Интернету?


Своим опытом делится Олег Кулабухов:

Положить компонент TCP на форму и

How can I tell at runtime if I am connected to the internet?

Answer:
You can use the TCP component to retrieve the Local IP address. If it is "0.0.0.0" then there is no connection.

Example:

    procedure TForm1.Button1Click(Sender: TObject);
begin
if
TCP1.LocalIp = '0.0.0.0' then
ShowMessage('Your not connected!');
end;

[001856]



Содержание раздела