Download MetaTrader 5
To add comments, please log in or register
Publish your task in Freelance service and developers will execute your order.
Hery Setiawan
247
Hery Setiawan 2014.04.28 08:01 

this one is work for me

#define READURL_BUFFER_SIZE   1000
#import  "Wininet.dll"
   int InternetOpenW(string, int, string, string, int);); 
   int InternetOpenUrlW(int, string, string, int, int, int);
   int InternetReadFile(int, uchar & arr[], int, int & arr[]);
   int InternetCloseHandle(int);
#import
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
{
//---
   int HttpOpen = InternetOpenW(" ", 0, " "," ",0 ); 
   int HttpRequest = InternetOpenUrlW(HttpOpen, "http://wwp.greenwichmeantime.com/time/scripts/clock-8/x.php", NULL, 0, 0, 0);
   string page = "";
   
   while (true)
   {
      int read[1];
      uchar arrReceive[];
      ArrayResize(arrReceive, READURL_BUFFER_SIZE + 1);
      
      InternetReadFile(HttpRequest, arrReceive, READURL_BUFFER_SIZE, read);
      if (read[0] > 0) {
         string strThisRead = CharArrayToString(arrReceive, 0, read[0], CP_UTF8);
         page = StringConcatenate(page, strThisRead);
      }
      else break;
   }
   
   if (HttpRequest > 0) InternetCloseHandle(HttpRequest); 
   if (HttpOpen > 0) InternetCloseHandle(HttpOpen);
   MessageBox(page, "HTTP READ:" );

  }
//+------------------------------------------------------------------+
Keith Watford
Moderator
8026
Keith Watford 2014.04.28 08:12  
What is the point of your post?
/
To add comments, please log in or register