Thanks in advance
🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Checking server for a file
anyway, you can use the WinInet functions, which are pretty simple to use. first you have to create an internet handle, which is used to create everything else. after that, you connect to a specific site and file, then you can read the file. here's code:
code:HINTERNET hInet = InternetOpen("name of this program", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);HINTERNET hConnect = InternetOpenUrl(hInet, "http://www.gamedev.net/blabla.bla", NULL, 0, 0, 0);// read the file and write it somewhereint fSave = _open("data.sav", _O_BINARY | _O_WRONLY | _O_CREAT, _S_IWRITE);BYTE buff[1024];DWORD dwRead;while (InternetReadFile(hConnect, buff, 1024, &dwRead)){ if (dwRead == 0) break; _write(fSave, buff, dwRead);}_close(fSave);InternetCloseHandle(hConnect);InternetCloseHandle(hInet);
hope that helps =) it also works with ftp. oh, and that string with "name of this program" can really be anything, i think it gets passed onto the server and can be used to profile the visitors, not sure on that however. you also have to include "wininet.h" and link to "wininet.lib"
------------------
http://members.xoom.com/mutex0
[This message has been edited by mutex (edited October 17, 1999).]