手机归属地演示代码示例
申请key值( http://www.haoservice.com/docs/14 )后输入要查手机号就可以用了,刚测试完,没问题.
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 IP
{
class Program
{
static void Main(string[] args)
{
string key = "***********************************";
string phone = "***********";
string url = "http://apis.haoservice.com/mobile?phone=" + phone + "&key=" + key;
WebClient wc = new WebClient();
wc.Encoding = Encoding.UTF8;
string str = wc.DownloadString(url);
Console.WriteLine(str);
Console.ReadKey();
}
}
}