.net - Help with InternetOpenUrl and InternetReadFile in <WinInet.h> API -
I'm just trying to access a page using WinInet API. Once I have access to it, I want to be able to read the contents in a string. I have already started the root node. I even got what I have so far:
hinterter hChildURL = InternetOpenUrl (hInternetRoot, LPCTSTR ("http: // www .google.com / ")), tap, 0, 0, 0); After this, I know that in order to actually remove the data, you have to use an internetredfile. Does anyone provide a detailed example of how to do this? I am not particularly familiar with the C-style file functions and by using buffers, please make it easy for me. On another note, should I use a different or more modern Windows API instead? In the long run I have been assigned to develop an app that will act as a customer and send Rick data using the HTTP and HTTPS with the remote server. Am I going on the right track?
Edit: To be more specific about the requirements: It should be written in C ++, it should be compatible with Win XP and above, and it only uses standard window libraries should do . Apart from this, I am free to work independently.
Well, you can read it in one part at a time:
Hunterter Request = Internet OpenOur (...); If (request! = Null) {BYTE buffer [8192]; DWORD bitrate; While (InternetRedFile (Request, Buffer, 8192, and Bitrate) & amp; amp; amp; and BitesRed! = 0) {// Do something with buffer} InternetCloseHandle (request); Request = zero; }
Comments
Post a Comment