标签:
//淘宝IP地址库http://ip.taobao.com/accurancy.php string url = "http://ip.taobao.com/service/getIpInfo.php?ip=122.224.94.210"; string responseText = ""; 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 str = new System.IO.StreamReader(responseStream, System.Text.Encoding.GetEncoding("GBK")); responseText = str.ReadToEnd(); str.Close(); str.Dispose(); responseStream.Close(); Console.WriteLine(responseText); string value = "\u676d\u5dde\u5e02"; Console.WriteLine(Uri.UnescapeDataString(value));//输出:杭州市
标签:
原文地址:http://www.cnblogs.com/BABLOVE/p/4478643.html