2010-07-28 120 views
0

我有一个像HTTP URL%3A%2F%2Fwww%2Ewikimoveis%2Ecom%2Ebr%2Ffotos%2F1292%2FKO2551%2FDSC01366%2EJPG十六进制地址译码器C#

我需要得到它正确解码。我相信这是十六进制。找不到任何C#代码。

谢谢

+0

可能重复[C#URLDecode轮流%5C为\\\\而不是\(http://stackoverflow.com/questions/608453/c -urldecode-turns-5c-into-instead-of) – 2010-07-28 14:56:24

回答

6

C# URLDecode turns %5C into \\\\ instead of \

using System; 
using System.Web; 

string url = "http%3A2F%2Fwww%2Ewikimoveis%2Ecom%2Ebr%2Ffotos%2F1292%2FKO2551%2FDSC01366%2EJPG" 
string decoded = HttpUtility.UrlDecode(url); 
+0

谢谢。对不起,愚蠢的问题...绝望的时候:) – 2010-07-28 13:24:54

+1

也许我说过这个地方......但没有愚蠢的问题,只有问题的答案是明显的。如果(例如因为绝望的时候)答案对你而言并不明显,那很好。 – MvanGeest 2010-07-28 13:28:55

+0

你是对的......谢谢! – 2010-07-28 21:15:38