Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


C++: Downloading server response to string

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
iCucco
Advanced Cheater
Reputation: 0

Joined: 11 May 2007
Posts: 51
Location: 0x0600

PostPosted: Thu Jan 17, 2008 12:05 pm    Post subject: C++: Downloading server response to string Reply with quote

Hello there,
I have been learning C++ for some time now but I'm still staying in console-oriented programming for now. I'm trying to implement a simple login script that connects to predefined PHP script with (maybe GET protocol) username and password, which server analyzes and sends response whether the login was correct or if it has failed.

As I have coded in C# previously, I'm going to post here what the connection snippet should look like:
Code:

WebClient WC = new WebClient();
Stream LogonResponse = WC.OpenRead("http://myurl.net/login.php?loginID=" + id + "&loginPW=" + pw);
StreamReader ReadingResponse = new StreamReader(LogonResponse);
string LogonString  = ReadingResponse.ReadLine();
if(LogonString = "CODESUCCESS[random predefined numbers]"){
     LoginSuccess();
}else FatalError("LOGINFAILURE");


Obviously I could do this with C# but the point is to learn C++ so...
What I'm asking is just some advice with the server connecting part as I'm doing this as a practice for future use. I tried googling first but with no good success. I'm thankful for ANY advice as I'm nearly stuck with this issue.

Cheers Smile

_________________
printf("You just ate a %X!!\n",3735928559);
Back to top
View user's profile Send private message
stealthy17
Expert Cheater
Reputation: 0

Joined: 10 Apr 2007
Posts: 144
Location: The Netherlands

PostPosted: Thu Jan 17, 2008 12:09 pm    Post subject: Reply with quote

You're talking about C++ .Net or native C++ ?

With C++ .Net it's kinda the same i guess...
Back to top
View user's profile Send private message
mer0x
Advanced Cheater
Reputation: 0

Joined: 06 Jan 2008
Posts: 63

PostPosted: Thu Jan 17, 2008 12:23 pm    Post subject: Reply with quote

native C++
Back to top
View user's profile Send private message
iCucco
Advanced Cheater
Reputation: 0

Joined: 11 May 2007
Posts: 51
Location: 0x0600

PostPosted: Thu Jan 17, 2008 12:25 pm    Post subject: Native Reply with quote

Yup, native C++. I got tired of .NET because of its restrictions about kernel-level functions needed in gamehacking purposes Very Happy
_________________
printf("You just ate a %X!!\n",3735928559);
Back to top
View user's profile Send private message
stealthy17
Expert Cheater
Reputation: 0

Joined: 10 Apr 2007
Posts: 144
Location: The Netherlands

PostPosted: Thu Jan 17, 2008 12:27 pm    Post subject: Reply with quote

Then it's going to be way different.
You don't have small and easy WebClient() etc.

- Edit #1

Googled a bit and found this;
http://www.example-code.com/vcpp/http_get.asp

Might help if you need your app quickly but if you want you could Google a bit about C++ and Winsock

Shouldn't be too hard to send a little GET request and store the incoming data to a var (array or so)
Back to top
View user's profile Send private message
iCucco
Advanced Cheater
Reputation: 0

Joined: 11 May 2007
Posts: 51
Location: 0x0600

PostPosted: Thu Jan 17, 2008 12:38 pm    Post subject: Reply with quote

Okay thanks, I'll check that link now. I'll keep you posted..
EDIT: I googled a bit more and found this library called "libcurl". Maybe that is what I'm looking for.

_________________
printf("You just ate a %X!!\n",3735928559);
Back to top
View user's profile Send private message
stealthy17
Expert Cheater
Reputation: 0

Joined: 10 Apr 2007
Posts: 144
Location: The Netherlands

PostPosted: Thu Jan 17, 2008 12:55 pm    Post subject: Reply with quote

Visual just means using Microsoft Visual C++ compiler/debugger afaik.
Back to top
View user's profile Send private message
iCucco
Advanced Cheater
Reputation: 0

Joined: 11 May 2007
Posts: 51
Location: 0x0600

PostPosted: Thu Jan 17, 2008 12:56 pm    Post subject: Reply with quote

stealthy17 wrote:
Visual just means using Microsoft Visual C++ compiler/debugger afaik.

Yup yup I already googled and found out Very Happy

_________________
printf("You just ate a %X!!\n",3735928559);
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites