bonjour,

y aurai t il une facon plus simple,
pour metre dans une variable le contenu d une page web?

merci

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
#include <stdlib.h>
#include <iostream>
#include <fstream>
 
using namespace std;
 
int main ()
{
  int i;
 
  i = system ("wget -q http://www.toto.com");
  cout << "#" << i << "#" << endl;
  if (i == 0)
    {
      int length;
      char * buffer;
      ifstream is;
 
      is.open ("index.html");
      is.seekg (0, ios::end);
      length = is.tellg();
      is.seekg (0, ios::beg);
      buffer = new char [length];
      is.read (buffer,length);
      is.close();
      cout.write (buffer,length);
      delete buffer;
    }
}