Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Copyright (c) 2012 [iPs]TeaM
- * Bruno da Silva (email@brunodasilva.com)
- * Função url_get_contents em c++
- *
- * www.brunodasilva.com
- * www.ips-team.forumeiros.com
- */
- #include <urlmon.h>
- #pragma comment(lib, "urlmon.lib")
- // file_get_contents :)
- char * url_get_contents(TCHAR * url) {
- char * retorno;
- retorno = (char *) malloc(256 * sizeof(char));
- if(S_OK == URLDownloadToCacheFileA(NULL, url, retorno, 255, 0, NULL)) {
- char
- tmpString[100]
- ;
- FILE * fp = fopen(retorno, "r");
- retorno[0] = 0;
- while (fgets (tmpString, 100, fp) != NULL) {
- strcat(retorno, tmpString);
- }
- fclose(fp);
- return retorno;
- }
- return NULL;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement