I was working with porting the sample from the link below to a Windows 8 Metro styled app
http://aws.amazon.com/code/Product-Advertising-API/2480
Looks like many features from the web model are removed (or moved) in WinRT:
HttpUtility.UrlEncode
HttpUtility.UrlDecode
HMAC / HMACSHA256
to name a few, I was wondering if anyone could help with finding alternatives to these on WInRT? I looked online and there's very little insight.
Use methods from the WebUtility class instead:
System.Net.WebUtility.UrlEncode(string);
System.Net.WebUtility.UrlDecode(string);
Theres source code for URLDecode here, and looks like Uri.EscapeDataString can be used for Encode.
http://www.koders.com/csharp/fid1A50096D8FA38302680B0EEDAC5B1CE1AEA855D0.aspx?s=%22Lawrence+Pit%22
copy the source code over, change the GetChars function to this
static char [] GetChars (MemoryStream b, Encoding e)
{
return e.GetChars (b.ToArray(), 0, (int) b.Length);
}
I had to use the code snippet from here to properly hash encrypt the string http://channel9.msdn.com/Forums/TechOff/Porting-to-WinRT/4df7586e1ef5400682eda00f0143b610
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With