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

Windows 7
Windows 7 default user account control worries experts. Corporate IT departments should be pleased w

$_POST variable un-useable
I'm trying to use a $_POST variable in a mysql update statement but i can't use it for some unknown

trouble printing an array....
I'm having some trouble printing out an array forwards. I'm figuring out the high and low of an arra

Trigger tag in aspx is not coming
hi all ,iam new to ajax, iam using file upload inside the update pannel but right now i want to use

need help with mail()
hi i want to send an email with attaching pdf file using php. i have the following script but the pr

remove trailing slash from array
I have the following array which contains trailing slashes I need to remove. What is the best way to

Add_Months not Easy to Understand
Oracle is number 1, very fast and very easy. But....
OK, I think but have a problem, only 1 pro

ctype() validation - allowing illegal characters
Hello,
I use ctype() to filter and validate a user form. However, I am trying to allow certain c

Calculus Help (and by help I mean homework)
Hrmmm, I hate posting about math homework, partly because it's homework, and partly because I hate w

echo $rows help
Hi all,

Hopefully something simple that I don't know!

I have this:

Code: [Selec

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