mardi 1 mars 2016

c++ download string from URL (Simalar to c#'s WebClient DownloadString function)? [duplicate]

This question already has an answer here:

Hello I'm very new to c++, I've started working with it around 2 months ago, I'm used to using c#'s DownloadString() function, and have been researching a way to get the same result in c++ and have not been successful.

I've tried the following code with no luck:

string url = "test url here";
cout << "Downloading string...";
HRESULT hr = URLDownloadToFile ( NULL, _T(url), 0, NULL );
cout << "Done :)" << endl;

Is there any possible to achieve what I'm trying to accomplish (Download a string from a file on my web server. For example if the file on my web server had the text "Hello" within it i would be able to use c++ to get the text from the file on my web server)?




Aucun commentaire:

Enregistrer un commentaire