What can I use for .NET CF as a replacement for HttpUtility.UrlEncode

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?

+5
source share
4 answers

Use Uri.EscapeDataString . This is almost equivalent, and probably all the same, and is included in NetCF.

Read more about their differences .

+12
source

- ( ). , . .

0

, , . , , UrlEncode, , , paramater .

: ...

0

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

0
source

All Articles