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

login and redirect
hello! can someone help me.. can you give me an idea.. I want to make a login page and redirects it

$_GET problem
Hi all,

Have a bit of a problem with a little piece of code, I am not sure if this should be

Save file by click
Hello.
I'm not understand how to save file from page. I'd like make link to file with save abil

Required to login help
I'm trying to set up my site so users have to be logged into the forum to access the site.I've been

PHP page loading in Firefox but not in IE
hello,

i am currently doing a project in PHP and i have a problem. If I view the project in M

How do i use vars in an array
Hiya peeps!

How do I use a var in an array. You will see $id but it isnt working.


using file_get_contents??
okay how would i create a script using file_get_contents() in php have it grab search pages 1-20 and

Images in email problem
I found this script for sending emails, it works but if the email has <img src="image.jp

Bar charts using Graphical Framework.
I am using Graphical Frameworks(GFW) to create a chart Graphic . There is no problem with the data d

Custom Container in module pool program
Hello everyone,

I have created a custom control in my module pool screen. Now I want to s

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