按键精灵安卓版访问php接,按键安卓版网络访问之 图片处理,FTP,HTTP 实现

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

必备工具:

1.海草同步器 下载地址: http://pan.baidu.com/s/1c0nLwi8

2.修改版 File.lua : http://pan.baidu.com/s/1o69fE1G

按键精灵代码:

//Http获取HTTP请求

Function HttpGet(url)

Dim sTime,rpath,requestPath

sTime = Time()

requestPath = "/mnt/sdcard/sweadsync/"

rpath = requestPath & "request.txt"

File.Write rpath, url

Do

Delay (1000)

If File.Exist(rpath) = False Then

HttpGet = File.Read(requestPath & "response.txt")

Exit Function

End If

Loop While (Time() - sTime) < 30

HttpGet = ""

End Function

//Ftp获取文件

Function FtpGet(remotepath,localpath,user,pass)

Dim sTime,rpath,requestPath

sTime = Time()

requestPath = "/mnt/sdcard/sweadsync/"

rpath = requestPath & "ftpget.txt"

File.Write rpath, remotepath & "," & localpath & "," & user & "," & pass

Do

Delay (1000)

If File.Exist(rpath) = False Then

FtpGet = File.Read(requestPath & "ftpgetResult.txt")

Exit Function

End If

Loop While (Time() - sTime) < 30

FtpGet = ""

End Function

//Ftp上传文件

Function FtpPut(remotepath,localpath,user,pass)

Dim sTime,rpath,requestPath

sTime = Time()

requestPath = "/mnt/sdcard/sweadsync/"

rpath = requestPath & "ftpput.txt"

File.Write rpath, remotepath & "," & localpath & "," & user & "," & pass

Do

Delay (1000)

If File.Exist(rpath) = False Then

FtpPut = File.Read(requestPath & "ftpputResult.txt")

Exit Function

End If

Loop While (Time() - sTime) < 30

FtpPut = ""

End Function

//处理不同分辨率是图片比较必用

Function ImageOpt(src,newsrc,rotate,scale) //本地链接地址,生成后的图片链接,旋转角度,图片放大缩小值

Dim sTime,rpath

sTime = Time()

rpath = requestPath & "imageopt.txt"

Call File.Write(rpath, src & "," & newsrc & "," & rotate & "," & scale)

Do

Delay (1000)

If File.Exist(rpath) = False Then

ImageOpt= newsrc

Exit Function

End If

Loop While (Time() - sTime) < 30

ImageOpt = ""

End Function

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
相关函数说明:http://www.uudama.com/process.html 源码页面:http://dll.uuwise.com/index.php?n=ApiDoc.Anjian 按键精灵插件: 新插件[2013.7.13]下载地址:http://com.uuwise.com/index.php?n=ApiDoc.DLLdownLoad <---推荐使用 经过不段改进程序源代码,最终实现了原生COM组件放到按键精灵目录下面就可以使用了,函数调用方法参考COM函数说明,示例语句在下面 注:不需要regsvr32注册 旧插件: [2013.7.2]---按键精灵插件完全--基于动态连 [2013.7.2]---按键精灵插件精减,仅【登录,上传图片,取结果,报错】四个函数--基于动态连 调用示例语句: softID = 2116 //软件ID 软件和KEY在开发者后台获取 softKEY = "2000adff4e5c4c448f45944c643b2b10" //软件key userName = "优优用户帐户" //用户的用户名,非开发者帐号 passWord = "优优用户密码" //密码 zhuce = Plugin.UU.SetSoftInfo(softID, softKEY) //初始化软件(必须) login = Plugin.UU.Login(userName, passWord) //登录优优,仅需要调用一次(必须) If login > 0 Then getUserScore=Plugin.UU.getScore(userName,passWord) //查询用户当前积分(可选) MessageBox "登录成功,您的用户ID为:" & login & ",您的剩余题分为:" & getUserScore yzmID = Plugin.UU.upLoadFile("c:\1.jpg", 1) //调用识别函数,根据路径上传,参数中的1为图片类型ID(表示需要识别的图片为四位英文或数字) //yzmID = Plugin.UU.recognizeScreenByCodeType(7,165,25,15,1,0) //截图并上传函数 //请参考:http://dll.uuwise.com/index.php?n=ApiDoc.Price If yzmID > 0 Then MessageBox "已将您的图片上传至优优,请耐心等待识别结果!" yzm=Plugin.UU.getResult(yzmID) //根据验证码ID获取识别结果 MessageBox "图片的识别结果为:" & yzm & "该图片在服务器上的ID为:" & yzmID /* //如果图片识别不正确,调用 !如何判断识别不正确?用户登录网站的时候, //如果验证码识别不正确,网页会有相关提示,其它应用应该差不多。 //注意:恶意报错(打正确也报),会同时冻结您的开发者帐户及用户帐户。 reportStatus = Plugin.UU.reportError(yzmID) If reportStatus=0 Then MessageBox "恭喜您报错成功,题分已返还至您的用户帐户!" End If */ Else MessageBox "上传图片出现错误,错误代码为:" &yzmID //错误代码请参考:http://dll.uuwise.com上各对应函数 End If Else MessageBox "对不起,登录失败,错误代码为:" &login //错误代码请参考:http://dll.uuwise.com上各对应函数 End If
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值