码迷,mamicode.com
首页 > 其他好文 > 详细

简单编码解码学习

时间:2015-05-05 12:25:33      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:

技术分享
 //淘宝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));//输出:杭州市
View Code

 

简单编码解码学习

标签:

原文地址:http://www.cnblogs.com/BABLOVE/p/4478643.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!