-
C++ Http request?
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.
-
Re: C++ Http request?
Take a look at the wininet API. There are similar API functions for your .NET versions.
http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx