学习编程的第N天,发现一个超简单验证码短信接口对接DEMO示例
#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <time.h>
#include <errno.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#define IPSTR "106.ihuyi.com"
#define PORT 80
#define BUFSIZE 1024
//调试日期 2015-07-27
//linux下的编译方法 gcc -o sms sms.c
int main(int argc, char **argv)
{
int sockfd, ret, i, h,srandnum;
struct sockaddr_in servaddr;
char str1[4096], str2[4096], buf[BUFSIZE], *str;
socklen_t len;
fd_set t_set1;
struct timeval tv;
if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0 ) {
printf("创建网络连接失败,本线程即将终止---socket error!\n");
exit(0);
};
C语言怎么给手机发短信
最新推荐文章于 2023-06-10 15:10:34 发布
本文详细介绍了如何在Linux环境下利用C语言编程实现向手机发送短信的功能,涉及到了通信协议、库函数的使用以及相关开发技巧。
摘要由CSDN通过智能技术生成