I know some one like me wanna use the UrlEncode when he/she code on the .Net Compact Framework or Sliverlight.
Here I copy and fix the code from System.Web.dll via reflector.
Its include all the UrlEncode / UrlDecode and other utility methods.
You can use they in any .Net Frameworks.
Download the c# source code here (both files are needed):