zoukankan      html  css  js  c++  java
  • 手机验证码解决方法

    前序工作:添加项目,给账户充钱

    require 'net/http'
    url = URI.parse('http://116.255.240.184/do.aspx')
    response = Net::HTTP.post_form(url,{'action' => 'loginIn','uid'=>'1','pwd'=>'1'}) #登录 函数 ,用户名,密码
    puts response.body
    token= response.body.split('|')[1]
    puts token
    response = Net::HTTP.post_form(url,{'action' => 'cancelSMSRecvAll','uid'=>'1','token'=>token}) #取消一个短信接收,可立即解锁被锁定的金额 返回的token ,用户名

    puts response.body
    response = Net::HTTP.post_form(url,{'action' => 'getMobilenum','pid'=>'511','uid'=>'1','token'=>token}) #得到手机 ,项目编号,用户名,token
    puts response.body
    tel= response.body.split('|')[0] #tel='13434493096' #输入手机到****获取验证码,然后等待10秒再去获取
    sleep 10
    response = Net::HTTP.post_form(url,{'action' => 'getVcodeAndReleaseMobile','mobile'=>tel,'token'=>token,'uid'=>'1'}) #得到验证码
    while response.body=="not_receive"
    response = Net::HTTP.post_form(url,{'action' => 'getVcodeAndReleaseMobile','mobile'=>tel,'token'=>token,'uid'=>'1'})
    sleep 1
    puts "not_receive"
    end
    puts response.body  这样就得到了相关验证码

    运行产生的信息

    C:RailsInstallerRuby1.9.3in uby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) D:/Documents/RubymineProjects/untitled/post.rb
    a4727603|e01034b93982fa900f650f536cb4b2dc
    e01034b93982fa900f650f536cb4b2dc
    1
    18318624721|f7adee988bfaf74eb0222d8459fcf8b7
    not_receive
    not_receive
    not_receive
    10657521833285514|尊敬的玩家:您的注册验证码为:776558,验证码将于3分钟后失效。【多多游戏】

    Process finished with exit code 0

  • 相关阅读:
    mysql的存储过程
    一份php高级工程师的面试题,我每天看一点点
    php的常用函数(持续更新)
    php 中文字符串截取
    php递归遍历文件目录
    ajax timeout 断网处理
    angular 刷新问题
    angular state中templateUrl 路径的模板
    angular请求传递不了数据
    截取字符串 substring substr slice
  • 原文地址:https://www.cnblogs.com/tester-huang/p/4632418.html
Copyright © 2011-2022 走看看