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

📄 main.cpp

📁 移动梦网平台主程序
💻 CPP
字号:
#include <stdio.h>#include <string.h>#include <time.h>#include <stdlib.h>#include <sys/types.h>#include <sys/stat.h>#include <unistd.h>#include "../include/define.h"#include "mysql/mysql.h"#include "../include/sm_tools.h"#include "../include/sm_db.h"#include "main.h"#define SELF_TYPE	"main"#define INIFILE "../config/sm.ini"char SP_ID[20];char db_host[100],db_user[100],db_passwd[100],db_dbname[100];MYSQL *myconn;static int InitPara(){	myconn = NULL;	GetProfileString(INIFILE,"DB_LOCAL","HOST","localhost",db_host);	GetProfileString(INIFILE,"DB_LOCAL","LOGNAME","root",db_user);	GetProfileString(INIFILE,"DB_LOCAL","LOGPASS","",db_passwd);	GetProfileString(INIFILE,"DB_LOCAL","DBNAME","NW_SM_TEST",db_dbname);	GetProfileString(INIFILE,"COMMON","SP_ID","5566",SP_ID);	/*InitPoint();	Initllysgb();	InitTrans();	InitSuanMing();	Initgb();	InitEQALL();	InitChance_new();	InitSendwait();	InitTest();	InitBet18month();	InitZldbp();	Initzhenren();	Initzfy5d();	Initcyds();	Initdianshi();	INItdiantai();   	//电台程序	2006.02.27增加 WCZ 程序kind为:ZD,名称diantai.cpp*/InitQyzx();InitQgjl();	InitZxcl();InitYsjk();InitPush();InitError();return 0;}static int DoThread(){	int retval,selfadd;	FILE *fp_ok;	char file_ok[50],day[20];		sprintf(file_ok,"wrong/w%s",getnowdate(day));	while(1)	{		fp_ok = fopen(file_ok,"w");		if(fp_ok == NULL)		{			puts("open file wrong");		}		fprintf(fp_ok,"begin\n");		fflush(fp_ok);		retval=0;				/*fprintf(fp_ok,"DoPoint\n");		fflush(fp_ok);		retval += DoPoint();						fprintf(fp_ok,"Dollysgb\n");		fflush(fp_ok);                retval +=Dollysgb();               			fprintf(fp_ok,"DoTrans\n");		fflush(fp_ok);                retval +=DoTrans();                		fprintf(fp_ok,"DoSuanMing\n");		fflush(fp_ok);                retval +=DoSuanMing();                		fprintf(fp_ok,"Dogb\n");		fflush(fp_ok);                retval +=Dogb();               		fprintf(fp_ok,"DoEQALL\n");		fflush(fp_ok);                retval +=DoEQALL();                		fprintf(fp_ok,"DoChance_new\n");		fflush(fp_ok);                retval +=DoChance_new();                		fprintf(fp_ok,"DoSendwait\n");		fflush(fp_ok);                retval +=DoSendwait();                		fprintf(fp_ok,"DoBet18month\n");		fflush(fp_ok);                retval +=DoBet18month();                		fprintf(fp_ok,"DoTest\n");		fflush(fp_ok);                retval +=DoTest();				fprintf(fp_ok,"DoZldbp\n");		fflush(fp_ok);                retval +=DoZldbp();                		fprintf(fp_ok,"Dozhenren\n");		fflush(fp_ok);                retval +=Dozhenren();                                fprintf(fp_ok,"Dozfy5d\n");		fflush(fp_ok);                retval +=Dozfy5d();                                fprintf(fp_ok,"Docyds\n");		fflush(fp_ok);                retval +=Docyds();                                                fprintf(fp_ok,"Dodianshi\n");		fflush(fp_ok);                retval +=Dodianshi();                                fprintf(fp_ok,"Dodiantai\n");		fflush(fp_ok);                retval +=Dodiantai();                */		fprintf(fp_ok,"DoQyzx");		fflush(fp_ok);		retval +=DoQyzx();                		fprintf(fp_ok,"DoQgjl");		fflush(fp_ok);		retval +=DoQgjl();				fprintf(fp_ok,"DoZxcl");		fflush(fp_ok);		retval +=DoZxcl();				fprintf(fp_ok,"DoYsjk");		fflush(fp_ok);		retval +=DoYsjk();       		fprintf(fp_ok,"DoPush");		fflush(fp_ok);		retval +=DoPush();        		fprintf(fp_ok,"DoError");		fflush(fp_ok);		retval +=DoError();            		fprintf(fp_ok,"DoExit");		fflush(fp_ok);		retval +=DoExit();		                fprintf(fp_ok,"end\n");		fflush(fp_ok);				//printf("retval=%d",retval);		//puts("end");		if(retval == 0)		{			sleep(2);		}				fclose(fp_ok);	}}int main(int argc,char * argv[]){	InitPara();		/*连接数据库*/	myconn = dbconnect(db_host,db_user,db_passwd,db_dbname);	if(myconn == NULL)	{		puts("连接数据库失败,请查看日志文件!");		return 0;	}		if(DoThread() != 0)	{		puts("查询信息出错!");		return 0;	}		return 0;}

⌨️ 快捷键说明

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