Hi, I'm a beginner in C++ and I need some help how to get a website's source code and save it into a string.

Oh, and also: how can I then search the source for a specific keyword AND how can I "extract" a word between 2 keywords ? Here's what I mean:

$source = _INetGetSource("http://www.google.com") ; get websites source
$stringBetween = _StringBetween($source,"a keyword","second keyword") ; this extracts a word between those two keywords

If StringInStr($source, "Google") Then ; this searches the source for a keyword Google
; do something
EndIf

This code is in autoit and I hope it'll help you understand what I need help with.

no, I gave the autoit code as an example of what I mean.
I want to know how to do the same thing but in C++

I don't know about one line, but it only takes a few lines with Wininet in Win32. And I'm sure you'll need more than one string to store a whole page in.

... And I'm sure you'll need more than one string to store a whole page in.

What's a problem? For example, in VC++ source.max_size() for std::string source is equal to 4294967294 bytes ;)

What's a problem? For example, in VC++ source.max_size() for std::string source is equal to 4294967294 bytes ;)

I've downloaded files larger than 4GB(till the game got a smart installer). Although I doubt he'll ever retrive something that LARGE. lol

This article has been dead for over six months. Start a new discussion instead.