C++ Http request?


Posted on 16th Feb 2014 07:03 pm by admin

Code: string Response = "LOGIN_UNSUCCESSFUL"; System.Net.WebRequest request = System.Net.WebRequest.Create("http://mywebsite.com/user.php"); string postData = "&do=login&vb_login_username=" + Username.Text + "&vb_login_password=" + Password.Text + "&HWID=" + GETHW.HWID; byte[] send = Encoding.Default.GetBytes(postData); request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = send.Length; Stream sout = request.GetRequestStream(); sout.Write(send, 0, send.Length); sout.Flush(); sout.Close(); WebResponse res; try { res = request.GetResponse(); StreamReader sr = new StreamReader(res.GetResponseStream()); Response = sr.ReadToEnd(); } I need to find some libraries for C++ to request a response like this C# program I made does. It sends the request with the specified data, then the script runs, echos a response and the program takes the response and uses it.

Thanks.

No comments posted yet

Your Answer:

Login to answer
201 Like 34 Dislike
Previous forums Next forums
Other forums

How can I uploading Transactional Data from Legacy to New SAP system
Hell Gurus,

I am overwhelmed with questions on how to migrate huge volume of Sales Orders

What are causes of a connection-timeout with fopen()?
Hello! Here is the situation: The server I host my website on just upgraded it's PHP build from 4.4.

HeaderSelectedCssClass not working
I have an accordian where I have a drop down list in the first pane and a grid in the second pane.

button.click += new eventhandler() not works in if(!ispostback)
i want to use button.clcik event in function VIewScrap() which is called in if(!ispostback) but itdo

array & querys help/advice.
Ok so here goes , I have a mysql database and basically here's what I need to do.

// foreach

Error when call dll from oracle
Hi all, please help me!

I have dll write C language, I want call it from oracle procedur

Sending CC Info by email
I am a little bit less knowledgable in the security area as most developers and I know I have a lot

Install page
How do I make it so when a user submits information on the Install page, it'll right it into the cor

simplexml_load_file and rss problem
Hi,

I have a problem parsing an rss feed using simplexml_load_file - this is strange as i hav

Remove directories not empty
hi,
i have an array that contains some names (1,4,6,56...). Every integer is a name of a folder.<

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash