Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Library: Internet / LAN / ASP.NET (https://www.delphipraxis.net/23-library-internet-lan-asp-net/)
-   -   Delphi Besteht eine Internet - Verbindung (https://www.delphipraxis.net/5886-besteht-eine-internet-verbindung.html)

Daniel B 22. Jun 2003 12:14


Besteht eine Internet - Verbindung
 
Hallo,

damit kann man überprüfen ob eine Internetverbindung besteht. Ist dies der Fall, so gibt die Funktion ein True zurück, ansonsten ein False.
Delphi-Quellcode:
function IsInternetConnected: Boolean;
begin
  if InternetGetConnectedState(nil, 0) then
  begin
    Result := True;
  end
  else
  begin
    Result := False;
  end;
end;
Grüsse, Daniel :hi:

Christian Seehase 22. Jun 2003 12:17

Moin Daniel,

was vereinfacht so aussähe:

Delphi-Quellcode:
function IsInternetConnected: Boolean;
begin
  Result := InternetGetConnectedState(nil, 0);
end;
:roll: :wink:

Daniel 22. Jun 2003 17:14

Hallo,

ich denke, interessant wäre hierbei der Wert des eigentlich vorhandenen Parameters, der hier mit NIL ungenutzt bleibt:

Zitat:

Zitat von MSDN-Library
Pointer to a variable that receives the connection description. This parameter can be one or more of the following values:

INTERNET_CONNECTION_CONFIGURED
Local system has a valid connection to the Internet, but it might or might not be currently connected.

INTERNET_CONNECTION_LAN
Local system uses a local area network to connect to the Internet.

INTERNET_CONNECTION_MODEM
Local system uses a modem to connect to the Internet.

INTERNET_CONNECTION_MODEM_BUSY
No longer used.

INTERNET_CONNECTION_OFFLINE
Local system is in offline mode.

INTERNET_CONNECTION_PROXY
Local system uses a proxy server to connect to the Internet.

INTERNET_RAS_INSTALLED
Local system has RAS installed.


Daniel B 23. Jun 2003 17:38

Hallo,

und hier noch ein paar Links zum Thema.

http://www.tutorials.de/tutorials115238.html
http://people.freenet.de/cpp-program...de/code31.html
http://www.tipps.delphi-source.de/LA...020914-2.shtml
http://www.tutorials.de/tutorials9900.html
http://home.t-online.de/home/Young.B...updown/003.htm
http://www.vb-fun.de/cgi-bin/loadfra.../tip0226.shtml
Microsoft
http://www.swissdelphicenter.ch/de/showcode.php?id=466
http://www.swissdelphicenter.ch/de/showcode.php?id=342
http://www.swissdelphicenter.ch/en/showcode.php?id=70

Grüsse, Daniel :hi:

[Edit=Sakura]Habe die MS-URL "ansehlicher" gemacht.[/Edit]

Daniel 23. Jun 2003 17:47

hihi ... ich habe auch noch einen Link zu diesem Thema:

http://www.marian-aldenhoevel.de/dojo/internet.html.

Am Ende steht der schöne Schluss, dass es eben nicht möglich ist, die Frage nach der Internetverbindung allgemeingültig zu beantworten.


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:40 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz