您的位置:首页 > 其它

移动联通基站定位演示示例

2014-10-09 10:55 225 查看
using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Net.Security;

using System.Security.Cryptography.X509Certificates;

using System.Net;

using System.IO;

using System.IO.Compression;

using System.Text.RegularExpressions;

using System.Web.Script.Serialization;

namespace phone

{

class Program

{

static void Main(string[] args)

{

string key = "****************************";//申请的key值

int mcc=460;

int mnc=0;

int cell_id=28655;

int lac=17695;

string url = "http://api.haoservice.com/api/getlbs?mcc="+mcc+"&mnc="+mnc+"&cell_id="+cell_id+"&lac="+lac"+"&key="+key;

WebClient wc = new WebClient();

wc.Encoding = Encoding.UTF8;

string str = wc.DownloadString(url);

Console.WriteLine(str);

Console.ReadKey();

}

}

}

移动联通基站接口返回示例

接口信息

URL:http://api.haoservice.com/api/getlbs

支持格式:json

http请求方式:GET

DEMO:http://api.haoservice.com/api/getlbs?mcc=460&mnc=0&cell_id=28655&lac=17695&key=您申请的KEY

返回结果:

{"location":

{"address":

{"region":"江苏省",

"county":"吴中区",

"street":"唯亭镇",

"street_number":"荷花广场",

"city":"苏州市",

"country":"中国"

},

"addressDescription":"江苏省苏州市吴中区波特兰小街唯亭镇荷花广场波特兰小街东",

"longitude":120.7259200,"latitude":31.2968700,"accuracy":"1000"

},

"access_token":null,

"ErrCode":0

}

备注:

先在网页 (http://www.haoservice.com/docs/1)上申请key值,填入参数.

若有错误,请参照一下代码表

错误代码表:

返回码 说明

0 成功

10001 错误的请求KEY

10002 该KEY无请求权限

10003 KEY过期

10004 错误的SDK KEY

10005 应用未审核超时,请提交认证

10007 未知的请求源,(服务器没有获取到IP地址)

10008 被禁止的IP

10009 被禁止的KEY

10011 当前IP请求超过限制

10012 当前Key请求超过限制

10013 测试KEY超过请求限制

10020 接口维护

10021 接口停用

10022 appKey按需剩余请求次数为零

10023 请求IP无效

10024 网络错误

10025 没有查询到结果
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: