Internetverbindung überprüfen
Verfasst: 29.03.2005 13:10
Hallo ich habe schon im codearchiv nachgeschaut aber nicht darüber gefunden, wie ich überprüfen kann ob eine Internetverbindung vorhanden ist.
Das deutsche PureBasic-Forum
https://www.purebasic.fr/german/
Code: Alles auswählen
Debug InternetGetConnectedState_(0, 0)
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.
Code: Alles auswählen
BOOL InternetCheckConnection(
LPCTSTR lpszUrl,
DWORD dwFlags,
DWORD dwReserved
);
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 );
Code: Alles auswählen
Debug InternetCheckConnection_("www.google.de", 0, 0)
Code: Alles auswählen
Debug InternetCheckConnection_("www.google.de", 1, 0)
Code: Alles auswählen
Debug InternetCheckConnection_("www.google.de", 1, 0)
Code: Alles auswählen
Debug InternetCheckConnection_("www.google.de", 0, 0)