[Request] Reading From WebPage

Posts 1–5 of 5 · Page 1 of 1
[Request] Reading From WebPage
I am looking for a C++ code to read from a webpage. So I basically need the below visual basic code transfered to C++. Thank you.

Code:
Dim Cache As String
Dim WorkingStatus
Cache = "http://example.co"
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(Cache)
Dim response As System.Net.HttpWebResponse = request.GetResponse()
Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream(), System.Text.Encoding.GetEncoding("windows-1252"))
WorkingStatus = sr.ReadToEnd()
Gawd... i dunno VB, but if no one else can figure it out, you will have to know some basics of MFC, but if you do you can look up definitions of VB function on MSDN and it will give you a translation of most into C++. see here: HttpWebRequest Class (System.Net)
I don't know nor like VB, So no.

But I have a script that can read easily from web-config files, If they are formatted like XML files, Witch I use for my trainer, And then convert the info gathered to variables / text / whatever they need to be.

Interested in this ? Or you need to querry on a ''Normal'' Webpage ?

Mely

Psst ; What do you do in the C++ Section with a VB Siggy ?
Hmm.. It seems you can do it in C++ the same way.

Here: MSDN

Straight off MSDN:
[php]
HttpWebRequest* myReq =
dynamic_cast<HttpWebRequest*>(WebRequest::Create(S "http://www.contoso.com/"));
[/php]

I have no idea if this is what you want, I don't have much experience with any of Microsoft's classes.
Posts 1–5 of 5 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us