Import "Cjson.lua"
Import "bt.lua"
Import "ShanHai.lua"
Dim json, table,Result,ID
--------- 以下是您需要修改的值 --------------
//你的帐号
Dim username="******"
//你的密码
Dim password="******"
//类型id
Dim typeid="1000"
//主图,根据实际情况修改图片名称和位置信息
SnapShot "/sdcard/image.jpg", 222, 274, 530, 589
//主图路劲 filepath
Dim filepath = GetSdcardDir() & "/image.jpg"
//副图,类型为1306和1316时需要,根据实际开发自己定义
-- SnapShot "/sdcard/subimage.jpg", 222, 274, 530, 589
-- Dim subfilepath = GetSdcardDir() & "/subimage.jpg"
--------- 需要修改的值结束 ----------------
If Dir.Exist(filepath) Then
TracePrint "存在"
Else
TracePrint "不存在"
End If
TracePrint filepath
json = bt.bt_sendcode(username, password, filepath, typeid)
//类型为1306和1316时需要,根据实际开发自己定义
-- json = bt.bt_sendcode(username, password, filepath, typeid, subfilepath)
TracePrint json
// 运行报错 请去除json < >的空格
// 运行报错 请去除json < >的空格
If json and json < > "" Then
TracePrint json
table = Cjson.Decode(json)
If table Then
If table["code"] = "0" Then
ID = table["data"]["captchaId"]
//识别结果
Result =table["data"]["recognition"]
TracePrint "验证码识别结果为: ", Result
Else
TracePrint "验证码识别失败"
End If
End If
Else
TracePrint "发送HTTP请求失败"
End If