AAuto 手机号码归属地查询

本文介绍了一个使用Aauto语言编写的手机号归属地查询程序。该程序通过调用showji API来获取输入手机号码的详细信息,包括省份、城市、区号、邮编及运营商等,并在界面上展示这些信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

调用一个查手机号的API

http://api.showji.com/Locating/help.htm

import win.ui;
/*DSG{{*/
var winform = ..win.form( min=false;bottom=291;parent=...;right=197;text="手机号归属地查询";max=false )
winform.add( 
static4={ bottom=212;right=188;left=17;top=192;z=6;transparent=1;text="城市区号:";cls="static" };
static6={ bottom=277;right=188;left=17;top=257;z=8;transparent=1;text="卡 类 型:";cls="static" };
static3={ bottom=180;right=188;left=17;top=160;z=5;transparent=1;text="归属城市:";cls="static" };
edit={ bottom=38;right=171;left=17;multiline=1;top=13;z=1;edge=1;cls="edit" };
button={ bottom=80;right=94;left=16;top=51;z=2;text="查询";cls="button" };
static={ bottom=115;right=188;left=17;top=95;z=3;transparent=1;text="所查号码:";cls="static" };
static5={ bottom=244;right=188;left=17;top=224;z=7;transparent=1;text="城市邮编:";cls="static" };
static2={ bottom=148;right=188;left=17;top=128;z=4;transparent=1;text="归属省份:";cls="static" }
)
/*}}*/

winform.button.oncommand = function(id,event){
        phone = winform.edit.text
        if( #phone!=11){
                winform.msgbox("号码必须是11位")
                return ; 
        }
        aa,bb,cc,dd,ee,ff,gg = get_phone( phone )
        winform.static.text = "所查号码:"+ aa
        winform.static2.text = "归属省份:"+ bb
        winform.static3.text = "归属城市:"+ cc
        winform.static4.text = "城市区号:"+ dd
        winform.static5.text = "城市邮编:"+ ee
        winform.static6.text = "卡 类 型:"+ ff + gg
}
get_phone = function( phone ){
        import inet.whttp
        http = inet.whttp(  );
        str= http.get( "http://api.showji.com/Locating/www.showji.com.aspx?m="+ phone +"&output=json&callback=querycallback");
      
       win.msgbox( str,"Welcome to AAuto" )
       
        str = string.fromto(str)
       
              win.msgbox( str,"Welcome to AAuto" )
       
        var regexExpression =  "\a+\p+(\d+)\p+\a+\p+\a+\p+\a+\p+(:+)\p+\a+\p+(:+)\p+\a+\p+(\d+)\p+\a+\p+(\d+)\p+\a+\p+(:+)\p+\a+\p+(\a+)" ;
        f = string.gmatch( str, regexExpression )
        return f(); 
}
winform.show() 
win.loopMessage();


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值