您好,登錄后才能下訂單哦!
#ifndef _GLOBALS_H
#define _GLOBALS_H
//--------------------------------------------------------------------
// Include Files
#include "lrun.h"
#include "web_api.h"
#include "lrw_custom_body.h"
#include "Ptt_Mysql.h"
#define MYSQLSERVER "ip"
#define MYSQLUSERNAME "user"
#define MYSQLPASSWORD "pwd"
#define MYSQLDB "xin"
#define MYSQLPORT 3306
MYSQL *Mconn;
int rc;
//--------------------------------------------------------------------
// Global Variables
#endif // _GLOBALS_H
vuser_init()
{
rc = lr_load_dll("libmysql.dll");
if (rc != 0) {
lr_error_message("Could not load libmysql.dll");
lr_abort();
}
// 連接到MySQL數據庫
Mconn = lr_mysql_connect(MYSQLSERVER, MYSQLUSERNAME, MYSQLPASSWORD, MYSQLDB, MYSQLPORT);
return 0;
}
{
lr_mysql_disconnect(Mconn);
return 0;
}
Action()
{
char *str;
char *old = "交易成功";
char *dengdai = "任務正在等待處理,請稍后~";
char *zhenxing = "查詢未完成,請稍后~";
char *ycldd;
int i,j;
char chQuery[128];
mysql_query(Mconn,lr_eval_string("SET NAMES gbk")); //遇到中文字符亂碼,在插入帶中文字的數據前,增加了如下語句:
sprintf(chQuery, "select t.userid,t.bank_id,t.username from xin.webank_apply_data t where t.login_mobile=14725001445;");
lr_mysql_query(Mconn, chQuery);
lr_save_string(row[0][0].cell, "userid");
lr_save_string(row[1][0].cell, "bank_id");
lr_save_string(row[2][0].cell, "username");
lr_output_message(lr_eval_string("userid: {userid}; bank_id: {bank_id}; username:{username}"));
//[desc] =>
web_reg_save_param_ex(
"ParamName=yansi",
"LB=[desc] => ",
"RB=\n",
"Ordinal=1",
SEARCH_FILTERS,
LAST);
//驗四
web_url("chouzhouyansi","URL=http://ip:3306/newCzCreditApply?user_ids={userid}",LAST);
str = lr_eval_string("{yansi}"); //取出關聯字段與實際值做比較。
lr_output_message("關聯字段: %s",str);
if(strcmp(str,old) == 0)
{
lr_think_time(5);
i:
web_reg_save_param_ex(
"ParamName=yuchuli",
"LB=[desc] => ",
"RB=\n",
"Ordinal=1",
SEARCH_FILTERS,
LAST);
ycldd = lr_eval_string("{yuchuli}");
//預處理
lr_output_message("預處理:%s","預處理");
lr_think_time(1);
web_url("chouzhouyuchuli","URL=http://ip:3306/newCzCreditQuery?user_ids={userid}",LAST);
lr_think_time(5);
if((strcmp(ycldd,dengdai) == 0) && (strcmp(ycldd,zhenxing) == 0))
{
lr_output_message("提示目前狀態是: %s",lr_eval_string("{jiayichenggong}"));
return 0;
}
else
{
lr_output_message("這是顯示結果:%s","eles中的語句");
lr_think_time(10);
web_reg_save_param_ex(
"ParamName=jiayichenggong",
"LB=[desc] => ",
"RB=\n",
"Ordinal=1",
SEARCH_FILTERS,
LAST);
web_url("chouzhouyuchuli","URL=http://ip:3306/newCzCreditQuery?user_ids={userid}",LAST);
ycldd = lr_eval_string("{jiayichenggong}");
if(strcmp(old,ycldd) == 0)
{
lr_output_message("交易成功");
lr_think_time(1);
}
else
{
goto i;
}
}
}
return 0;
}
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。