TC官方合作论坛
标题:
请教下传参到问题 一个功能方法能不能返回2个值 有源码 麻烦看下
[打印本页]
作者:
狂奔的蜗牛
时间:
2013-5-21 12:47
标题:
请教下传参到问题 一个功能方法能不能返回2个值 有源码 麻烦看下
源码如下:
我就是想只用一个功能方法让他返回账号和密码2个文本
namespace gmail
var Meter=0
var accnumber,Passwd
function getaccnumber(number)
EachLine=array[]
SpecificContent=array[]
Rtc=file.readfileex("d://zhh.txt") //读取账号路径
if(Rtc!="") // 内容不等于空白 才执行
var linenumber
str.split(Rtc,"\r\n",EachLine) // \r\n是换行符
arraysp.size(EachLine,linenumber)
if(EachLine[linenumber-1]=="") //避免最后一行出现空串 也写入内容
linenumber=linenumber-1
endif
endif
existence=file.exist("d://zhh1.txt")
if(existence)
help.sleep(500)
else
filehwnd=file.createfile("d://zhh1.txt","rw")
endif
for(i=Meter;i<=Meter;i++) //遍历账号文件
var linenumber
str.split(EachLine[i],",",SpecificContent)
arraysp.size(SpecificContent,linenumber)
for(j=0;j<1;j++)
number=SpecificContent[j]
PasswdID=SpecificContent[j+1]
endfor
endfor
return (number)
endfunction
function getPasswd(PasswdID)
EachLine=array[]
SpecificContent=array[]
Rtc=file.readfileex("d://zhh.txt") //读取账号路径
if(Rtc!="") // 内容不等于空白 才执行
var linenumber
str.split(Rtc,"\r\n",EachLine) // \r\n是换行符
arraysp.size(EachLine,linenumber)
if(EachLine[linenumber-1]=="") //避免最后一行出现空串 也写入内容
linenumber=linenumber-1
endif
endif
existence=file.exist("d://zhh1.txt")
if(existence)
help.sleep(500)
else
filehwnd=file.createfile("d://zhh1.txt","rw")
endif
for(i=Meter;i<=Meter;i++) //遍历账号文件
var linenumber
str.split(EachLine[i],",",SpecificContent)
arraysp.size(SpecificContent,linenumber)
for(j=0;j<1;j++)
number=SpecificContent[j]
PasswdID=SpecificContent[j+1]
endfor
endfor
return (PasswdID)
endfunction
function 当前()
//这里添加你要执行的代码
edit.settext("edit0",gmail.getaccnumber(""))
edit.settext("edit2",gmail.getPasswd(""))
endfunction
function 退出()
web.go("explorer0","https://mail.google.com/mail/u/0/?logout&hl=zh-CN&hlor")
endfunction
function go()
web.go("explorer0","gmail.com")
help.sleep(help.randto(100,150))
web.htmlinput("explorer0",gmail.getaccnumber(accnumber),"name:Email")
help.sleep(help.randto(100,200))
web.htmlinput("explorer0",gmail.getPasswd(Passwd),"name:Passwd")
help.sleep(500)
web.htmlclick("explorer0","class:g-button g-button-submit")
help.sleep(500)
Meter=Meter+1
endfunction
function 改密码()
web.go("explorer0","https://accounts.google.com/EditPasswd?hl=zh-CN")
help.sleep(1100)
web.htmlinput("explorer0",gmail.getPasswd(Passwd),"name:OldPasswd")
help.sleep(400)
web.htmlinput("explorer0","shangye2013","name:Passwd")
help.sleep(400)
web.htmlinput("explorer0","shangye2013","name:PasswdAgain")
help.sleep(400)
web.htmlclick("explorer0","save")
endfunction
function 改外发邮箱()
web.go("explorer0","https://mail.google.com/mail/?hl=zh-cn&shva=1#settings/accounts")
endfunction
function button2_click()
threadhwnd=thread.beginthread("gmail.改密码","")
endfunction
function button1_click()
threadhwnd=thread.beginthread("gmail.改外发邮箱","")
endfunction
function button3_click()
threadhwnd=thread.beginthread("gmail.退出","")
endfunction
function start_click()
threadhwnd=thread.beginthread("gmail.go","")
threadhwnd=thread.beginthread("gmail.当前","")
endfunction
function exit_click()
help.exit()
endfunction
function init()
threadhwnd=thread.beginthread("gmail.当前","")
web.cleartemp()
help.sleep(help.randto(200,500))
web.clearcookie()
help.sleep(help.randto(200,500))
web.go("explorer0","gmail.com")
help.sleep(help.randto(200,500))
endfunction
endnamespace
复制代码
作者:
狂奔的蜗牛
时间:
2013-5-21 12:48
可能有点乱。。。
作者:
Sky_Pro
时间:
2013-5-21 12:50
返回一个具有分隔符的串或者引用账号、密码都行
作者:
rggt1234
时间:
2013-5-21 12:50
全都是英文 木有看懂
作者:
狂奔的蜗牛
时间:
2013-5-21 12:52
回复
3楼
Sky_Pro
的帖子
那还不是 要开一个功能方法 在分割字符串。。我只是想简洁点。。
作者:
Sky_Pro
时间:
2013-5-21 13:06
回复
5楼
狂奔的蜗牛
的帖子
引用啊,那个不用返回啥
作者:
舍我其谁
时间:
2013-5-21 15:12
不清楚..........
作者:
zc1835429
时间:
2013-5-21 23:24
使用两个全局变量
欢迎光临 TC官方合作论坛 (http://bbs.52tc.co/)
Powered by Discuz! X3.1