I need to port .NET code to Compact Framework. This code uses HttpUtility.UrlEncode to encode request parameters, but System.Web is not available for CF. What can i use instead?
Use Uri.EscapeDataString . This is almost equivalent, and probably all the same, and is included in NetCF.
Read more about their differences .
- ( ). , . .
, , . , , UrlEncode, , , paramater .
: ...
Uri.EscapeUriString, Uri.EscapeDataString , ,
Uri.EscapeUriString
Uri.EscapeDataString
http://website.com/a/abc{d}d
EscapeDataString :
http%3A%2F%2Fwebsite.com%2Fa%2Fabc%7Bd%7Dd
Uri.EscapeUriString:
http://website.com/a/abc%7Bd%7Dd