private string gain(string Telnum)
{
string url = "https://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=" + Telnum;
System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(url);
System.Net.HttpWebResponse response = (System.Net.HttpWebResponse)request.GetResponse();
System.IO.Stream responseStream = response.GetResponseStream();
System.IO.StreamReader sr = new System.IO.StreamReader(responseStream, System.Text.Encoding.GetEncoding("gbk"));
string responseText = sr.ReadToEnd();
sr.Close();
sr.Dispose();
responseStream.Close();
string jsonData = responseText;
if (jsonData != null && !"".Equals(jsonData))
{
jsonData = jsonData.Substring(jsonData.IndexOf("{"), (jsonData.IndexOf("}")) - (jsonData.IndexOf("{")) + 1);
}
return GainJsonMy(jsonData);
}
public struct JsonClass
{
public string mts { get; set; } //属性的名字,必须与json格式字符串中的"key"值一样。
public string province { get; set; }
public string catName { get; set; }
public string telString { get; set; } //属性的名字,必须与json格式字符串中的"key"值一样。
public string areaVid { get; set; }
public string ispVid { get; set; }
public string carrier { get; set; }
}
public string GainJsonMy(String str)