Internetverbindung überprüfen
Internetverbindung überprüfen
Hallo ich habe schon im codearchiv nachgeschaut aber nicht darüber gefunden, wie ich überprüfen kann ob eine Internetverbindung vorhanden ist.
Code: Alles auswählen
Debug InternetGetConnectedState_(0, 0)
Zuletzt geändert von Leo am 29.03.2005 13:18, insgesamt 1-mal geändert.
Hilft das?MSDN hat geschrieben:InternetCheckConnection
Allows an application to check if a connection to the Internet can be established.
BOOL InternetCheckConnection(
LPCTSTR lpszUrl,
DWORD dwFlags,
DWORD dwReserved
);
Parameters
lpszUrl
[in] Pointer to a null-terminated string that specifies the URL to use to check the connection. This value can be NULL.
dwFlags
[in] Options. FLAG_ICC_FORCE_CONNECTION is the only flag that is currently available. If this flag is set, it forces a connection. A sockets connection is attempted in the following order:
If lpszUrl is non-NULL, the host value is extracted from it and used to ping that specific host.
If lpszUrl is NULL and there is an entry in the internal server database for the nearest server, the host value is extracted from the entry and used to ping that server.
dwReserved
[in] Reserved. Must be zero.
Now these points of data make a beautiful line.
And we're out of beta. We're releasing on time.
And we're out of beta. We're releasing on time.
Das mit MSDN, ist das ein code? und wenn das ein code ist, ist der überhaupt für PB?
[Edit] ja ok ich glaub ich habs doch gecheckt[/Edit]
[Edit] Das ist kein PB code, wie würde das ganze in PB aussehen?[/Edit]
[Edit] ja ok ich glaub ich habs doch gecheckt[/Edit]
[Edit]
Code: Alles auswählen
BOOL InternetCheckConnection(
LPCTSTR lpszUrl,
DWORD dwFlags,
DWORD dwReserved
);
-
- Beiträge: 6291
- Registriert: 29.08.2004 08:37
- Computerausstattung: Hoffentlich bald keine mehr
- Kontaktdaten:
BOOL gibts in PB nicht, ersetze das mit Long:zigapeda hat geschrieben:Das mit MSDN, ist das ein code? und wenn das ein code ist, ist der überhaupt für PB?
[Edit] ja ok ich glaub ich habs doch gecheckt[/Edit]
[Edit]Das ist kein PB code, wie würde das ganze in PB aussehen?[/Edit]Code: Alles auswählen
BOOL InternetCheckConnection( LPCTSTR lpszUrl, DWORD dwFlags, DWORD dwReserved );
Result.l = InternetCheckConnection_(lpszUrl.s, dwFlags.l, dwReserved.l)
Angenommen es gäbe einen Algorithmus mit imaginärer Laufzeit O(i * n), dann gilt O((i * n)^2) = O(-1 * n^2) d.h. wenn man diesen Algorithmus verschachtelt ist er fertig, bevor er angefangen hat.
Die Funktion ist merkwürdig.
Wenn ich das hier ausführe:kommt 0 (= Fehler) als Ergebnis.
Mache ich jedochkommt 1 (= Alles Ok) als Ergebnis.

Wenn ich das hier ausführe:
Code: Alles auswählen
Debug InternetCheckConnection_("www.google.de", 0, 0)
Mache ich jedoch
Code: Alles auswählen
Debug InternetCheckConnection_("www.google.de", 1, 0)


Now these points of data make a beautiful line.
And we're out of beta. We're releasing on time.
And we're out of beta. We're releasing on time.
Bei mir kommt bei beidem 0 rauß
= 0
= 0 

Code: Alles auswählen
Debug InternetCheckConnection_("www.google.de", 1, 0)
Code: Alles auswählen
Debug InternetCheckConnection_("www.google.de", 0, 0)
