TC官方合作论坛

 找回密码
 立即注册
查看: 955|回复: 0

[问题] 拨号API是不是没用

[复制链接]
发表于 2013-11-4 22:16:54 | 显示全部楼层 |阅读模式

马上加入TC

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
function main()
    var prefix,suffix,num,tmp,error,handle
    suffix=str.right(edit.gettext("username"),8)
    prefix=str.left(edit.gettext("username"),str.strleng(edit.gettext("username"))-8)
    num=type.cint(suffix)
    if(browse.gettext("logo")!=""&&radio.getstate("open")==true)
        handle=file.openfile(browse.gettext("logo"),"rw|FILE_SHARE_READ|FILE_SHARE_WRITE|OPEN_EXISTING|OPEN_ALWAYS")
    endif
    for(tmp=num;tmp<100000000;tmp++)
        suffix=type.cstring(tmp)
        edit.settext("username",prefix&suffix)

        //help.cmd("rasdial"&" "&edit.gettext("pppoe")&" "&edit.gettext("username")&" "&edit.gettext("password"),false)
        error=net.dialing(edit.gettext("pppoe"),prefix&suffix,edit.gettext("password"))
        help.sleep(type.cint(edit.gettext("overtime")))
        if(error==0&&radio.getstate("open")==true)
            file.writefileend(handle,"")
            file.writefileline(handle,"")            
            file.writefileend(handle,datetime.now()&"    "&"账号:"&prefix&suffix&"    "&"密码:"&edit.gettext("password"))
        endif
        if(error==0&&radio.getstate("close")==true)
            help.messagebox("账号:"&edit.gettext("username")&"\r"&"密码:"&edit.gettext("password"),"成功")
            button.settext("start","开始")
            return 0
        endif
        net.disconnect(edit.gettext("pppoe"))

    endfor
endfunction
代码如上,用help.cmd () rasdial 就行。。。是我使用不对吗?

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条

关闭

小黑屋|TC官方合作论坛 (苏ICP备18045623号)

GMT+8, 2024-9-23 16:01 , Processed in 0.033455 second(s), 23 queries .

Powered by 海安简单软件服务部

© 2008-2019 版权所有 保留所有权利

快速回复 返回顶部 返回列表