-sharpinclude<stdio.h>
-sharpinclude<string.h>
-sharpinclude<winsock2.h>
char buff[2001];
int main()
{
WSADATA wsaData;
WSAStartup(MAKEWORD(2, 0), &wsaData);
//
int sockfd=socket(AF_INET,SOCK_STREAM,0);//socket
struct sockaddr_in dest_addr; //
int size;
char s[]="GET / HTTP/1.1\r\n""Host:www.baidu.com\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6)Gecko/20050225 Firefox/1.0.1Connection: Keep-Alive\r\n";
//httpget
dest_addr.sin_family=AF_INET;
dest_addr.sin_port=htons(80);
dest_addr.sin_addr.s_addr=inet_addr("61.135.169.121");
memset(dest_addr.sin_zero,0,8);
// ipping
connect(sockfd,(struct sockaddr*)&dest_addr,sizeof(struct sockaddr));
//
printf("connect success");
send(sockfd,s,sizeof(s),0);
buff[recv(sockfd,buff,2000,0)]=0;
printf("%s",buff);
closesocket(sockfd);
return 0;
}