⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 send.cpp

📁 这个程序能够通过ip来查询实际地址利用的是ip138的数据库
💻 CPP
字号:

#include "buffer.h"
#include <stdio.h>
#include <winsock2.h>


void send_msg(char *ip, SOCKET s)
{
	char str[5];
	char send_buf[1024] = 
		"POST http://www.ip138.com/ips8.asp HTTP/1.1\r\n"
		"Accept: */*\r\n"
		"Referer: http://www.ip138.com/\r\n"
		"Accept-Language: zh-cn\r\n"
		"Content-Type: application/x-www-form-urlencoded\r\n"
		"Accept-Encoding: gzip, deflate\r\n"
		"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; "
		"SV1; GTB5; .NET CLR 2.0.50727)\r\n"
		"Host: 219.153.15.76\r\n"
		"Connection: Keep-Alive\r\n"
		"Connection: Keep-Alive\r\n"
		"Cache-Control: no-cache\r\n"
		"CONTENT-LENGTH: ";
	int content_length;

	content_length = 12 + (int)strlen(ip);
	_itoa_s(content_length, str, 5, 10);
	strcat_s(send_buf, 1024,str);

	strcat_s(send_buf, 1024, "\r\n\r\nip=");
	strcat_s(send_buf, 1024, ip);
	strcat_s(send_buf, 1024, "&action=2");

	send(s, send_buf, (int)strlen(send_buf), 0);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -