Results 1 to 5 of 5
  1. #1
    CoderNever's Avatar
    Join Date
    Feb 2009
    Gender
    female
    Location
    https://mpgh.net MPGHCash: $700,458,011
    Posts
    1,198
    Reputation
    131
    Thanks
    2,236
    My Mood
    Buzzed

    [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 = "https://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()

  2. #2
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    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)

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  3. #3
    Melodia's Avatar
    Join Date
    Dec 2009
    Gender
    female
    Posts
    2,608
    Reputation
    276
    Thanks
    1,662
    My Mood
    Dead
    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 ?
    Love You All~

  4. #4
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    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 "https://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.

  5. #5
    Gordon`'s Avatar
    Join Date
    Dec 2007
    Gender
    male
    Posts
    283
    Reputation
    24
    Thanks
    325


Similar Threads

  1. Requesting Sigs from me
    By Kyle in forum Help & Requests
    Replies: 0
    Last Post: 06-28-2009, 05:39 AM
  2. Reading from a memory address
    By isaacboy in forum Visual Basic Programming
    Replies: 0
    Last Post: 03-26-2009, 03:28 AM
  3. Reading from an INI file
    By Credzis in forum C++/C Programming
    Replies: 0
    Last Post: 11-28-2007, 02:18 PM
  4. [request] read this if u make hacks...
    By prox32 in forum WarRock - International Hacks
    Replies: 4
    Last Post: 04-25-2007, 02:59 PM
  5. [Tutorial] Reading from the CMD line
    By shercipher in forum C++/C Programming
    Replies: 7
    Last Post: 04-04-2006, 12:49 PM