I have been continuing work on my winsock.
My latest project is to make a program that will fetch the login prompt text from my router's(192.168.1.1) telnet prompt.The code mentioned below executes but shows a string I cannot make any sense of(its the same string always).
#include<winsock2.h>
#include<windows.h>
main()
{
WSADATA wsaData;
int starterr = WSAStartup(MAKEWORD(2,2), &wsaData);
SOCKET mysock = socket(AF_INET,SOCK_STREAM,0);
sockaddr_in anews;
anews.sin_port = htons(23);
anews.sin_addr.s_addr = inet_addr("192.168.1.1");
anews.sin_family = AF_INET;
connect(mysock,(sockaddr*)&anews, sizeof(anews));
char buf[200];
recv(mysock, buf, sizeof(buf), 0);
MessageBox(0,buf,"sd",0);
}
Thanks in advance for any suggestions.:)
While you read this message,corrupt politicians are gobbling up your hard earned money;rebels,armies and terrorists are torturing and killing hundreds of innocent men;companies are exploiting millions of people and ruining the environment,people are fighting each other on the basis of color,creed and religion and your nation is being slowly destroyed.
But whats REALLY worrying,is that I write color instead of colour. |