SHARE
TWEET

Untitled

a guest May 26th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <windows.h>
  2. #include <Wininet.h>
  3. #include <iostream>
  4. #include <string.h>
  5. #pragma comment(lib, "wininet.lib")
  6.  
  7. int main()
  8. {
  9.     char url[128];
  10.     strcat_s(url, "http://www.techtoolbox.com");
  11.     bool bConnect = InternetCheckConnection(url, FLAG_ICC_FORCE_CONNECTION, 0);
  12.  
  13.     if (bConnect) {
  14.         //internet connection exists !
  15.  
  16.         std::cout << "yes";
  17.     }
  18.     else {
  19.         std::cout << "no ";
  20.     }
  21.  
  22.     std::cin.get();
  23.     return 0;
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top