title: C++ If ("Char" == "value") { do
body: <p>I'm trying to get the html code of webpage and check the value of this code.
  I have this code, it not have errors but it not works, I want that if the code of the web its for example &quot;test&quot;, the program do an action. But now the program don do anything.
  There is my code:</p>
  <pre><code>void GetPage()
  {
     std::string check_command_link = (&quot;test.php?HWID=&quot; + name()); 
      HINTERNET hInternet = InternetOpenA(&quot;InetURL/1.0&quot;, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
      HINTERNET hConnection = InternetConnectA(hInternet, &quot;127.0.0.1&quot;, 80, &quot; &quot;, &quot; &quot;, INTERNET_SERVICE_HTTP, 0, 0);
      HINTERNET hData = HttpOpenRequestA(hConnection, &quot;GET&quot;, check_command_link.c_str(), NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0);
      char buf[2048];
      string lol;
      HttpSendRequestA(hData, NULL, 0, NULL, 0);
  
      DWORD bytesRead = 0;
      DWORD totalBytesRead = 0;
      while (InternetReadFile(hData, buf, 2000, &amp;bytesRead) &amp;&amp; bytesRead != 0)
      {
          buf[bytesRead] = 0;
          lol = lol + buf;
          if (buf == &quot;test&quot;) {
              //DO AN ACTION
              printf(&quot;Content;Test&quot;);
         }
          totalBytesRead += bytesRead;
      }
  
      InternetCloseHandle(hData);
      InternetCloseHandle(hConnection);
      InternetCloseHandle(hInternet);
  }
  </code></pre>
  <p>Thanks!</p>