C#(.net)调用手机号码查询接口示例:
using System;
using System.Collections.Generic;
using System.Web;
using System.Net;
public class IP138
{
public static string GetMobileData(string token, string mobile, string datatype = "txt")
{
string url = string.Format("https://api.ip138.com/mobile/?mobile={0}&datatype={1}&token={2}", mobile, datatype, token);
using (WebClient client = new WebClient())
{
return client.DownloadString(url);
}
}
}
string data = IP138.GetMobileData("00d5cb1fac5dc5cbfe2ff218222a2dfd33", Request.UserHostAddress);
Console.WriteLine(data);
Response.Write(data);