(Using the Get Method)
#include <windows.h>
#include <stdio.h>
void abc(char * p)
{
FILE * fp;
fp = fopen("a.txt","a+");
fprintf(fp,"%s",p);
fclose(fp);
}
long _stdcall zzz (HWND,UINT,WPARAM,LPARAM);
WNDCLASS a; HWND b;MSG c;long g,d;WSADATA ws;char aa[100];SOCKET s;
char bb[100],R[10000];int ii;struct hostent *h;struct sockaddr_in A;
char Headers[]=
"HTTP/1.0\r\n""User-Agent:AuthClient\r\n""Accept:*/*\r\n";
int _stdcall WinMain(HINSTANCE i, HINSTANCE j, char * k, int l)
{
a.hInstance = i;
a.lpszClassName="aaa" ;
a.lpfnWndProc = zzz ;
a.hbrBackground = GetStockObject(WHITE_BRUSH);
RegisterClass(&a);
b=CreateWindow("aaa","Title",WS_OVERLAPPEDWINDOW,1,1,10,20,0,0,i,0);
ShowWindow(b,3);
while(GetMessage(&c,0,0,0))
DispatchMessage(&c);
return 1;
}
long _stdcall zzz(HWND w,UINT x,WPARAM y,LPARAM z)
{
if (x == WM_LBUTTONDOWN)
{ g=WSAStartup(0x0101,&ws);
sprintf(aa,"WSAStartup..g=%ld..ws=%p",g,ws);
abc(aa);
MessageBox(0,aa,aa,0);
s=socket(AF_INET,SOCK_STREAM,0);
sprintf(aa,"socket..s=%ld..",s);
abc(aa);
MessageBox(0,aa,aa,0);
A.sin_family = AF_INET;
A.sin_port = htons(80);
h=gethostbyname("add-url.altavista.digital.com");
A.sin_addr.s_addr=*((unsigned long *) h->h_addr);
d=connect(s,(struct sockaddr *)&A,sizeof(A));
sprintf(aa,"Connect = %ld",d);
abc(aa);
MessageBox(0,"Connect",aa,0);
strcpy(bb,"GET");strcat(bb," ");
strcat(bb,"/cgi-bin/newurl?q=http%3A%2F%2Fwww.neca.com%2F%7Evmis");
strcat(bb," ");strcat(bb,Headers);strcat(bb,"\r\n");
MessageBox(0,bb,"Sent",0);
d=send(s,bb,strlen(bb),0);
sprintf(aa,"d=%ld",d);
abc(aa);
ii=1;
while(ii !=0)
{
ii=recv(s,R,sizeof(R),0);
abc(R);
sprintf(aa,"ii=%d",ii);
MessageBox(0,aa,aa,0);
}
MessageBox(0,aa,aa,0);
MessageBox(0,"over","over",0);
}
if (x == WM_DESTROY)
PostQuitMessage(0);
return DefWindowProc(w,x,y,z);
}
We will put up the explanations to these programs as soon as possible. Please visit us again . If you have any suggestions, comments, ideas, cracked code, feedback, feel free to get in touch with us.
Move back to the Vijay Mukhi's Technology Cornucopia Page to learn more about the other new Internet Technologies.
Vijay Mukhi's Computer Institute
VMCI, B-13, Everest Building, Tardeo, Bombay 400 034, India
E-mail:vmukhi@giasbm01.vsnl.net.in Tel : 91-22-496 4335 /6/7/8/9 Fax : 91-22-307 28 59
http://www.vijaymukhi.com