首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

C#转码.该如何处理

2011-12-30 
C#转码...急数据库存储的url地址为:http://localhost:8080/index.aspx?phase%D5%FD%B1%E0%BF%C9%D1%D0pha

C#转码...急
数据库存储的url地址为:
http://localhost:8080/index.aspx?phase=%D5%FD%B1%E0%BF%C9%D1%D0
phase挂带的字符串被IE自动转换了,   现在要提取出
%D5%FD%B1%E0%BF%C9%D1%D0转换为正常可读取的文本

注:写的程序为Console程序

[解决办法]
添加web引用

string s = "http://localhost:8080/index.aspx?phase=%D5%FD%B1%E0%BF%C9%D1%D0 ";

Console.WriteLine(System.Web.HttpUtility.UrlDecode(s.Split( '= ')[1], System.Text.Encoding.Default));
[解决办法]
楼上正解

热点排行