#property copyright "sangmane" #property link "" #import "Wininet.dll" int InternetOpenA(string, int, string, string, int); int InternetOpenUrlA(int, string, string, int, int, int); int InternetReadFile(int, string, int, int& OneInt[]); int InternetCloseHandle(int); #import int start() { Comment(""); string WebSource = "http://www.signals4forextrading.com/"; int hOpen = InternetOpenA("Agent Sangmane", 0, NULL, NULL , 0); if (hOpen != 0) { Comment("Connecting..."); int hFile = InternetOpenUrlA(hOpen, WebSource, NULL, 0, 0x80000000, 0); if (hFile != 0) { Comment("Connected, downloading file..."); int read[1]={0}; string page = ""; while (true) { string Buffer = " initial Empty "; int res = InternetReadFile(hFile, Buffer, StringLen(Buffer), read); if (read[0] == 0) break; page = page + StringSubstr(Buffer, 0, read[0]); } Comment(page); InternetCloseHandle(hFile); } InternetCloseHandle(hOpen); } return(0); }
sangmane:
Oh, thanks so much. Just like that you have the code that works. I guess I still a lot of learning to do.
Thanks again and again.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have wanted to read files from a www address. I found and worked with some code that does it. - It works - but if I change the data on the website and run the script again, it doesn't update the read on MT4. If I turn off and then turn on the MT4, and re-run the script I get a fresh read and it works, the first time. Surely there is a way to make a fresh read at each script run.
My thinking is there was a local cache. I tried to use the built in function to force the re-reading of the website, but I can't get it to work. I am really hoping someone can see the problem.