Monday, November 21, 2011

How to Decode and encoded URL in .NET

The code below illustrates how to decode an encoded url using HttpUtility.UrlDecode(string url)
Code:
  using System.Web;   
  //make sure to add reference to System.Web  
  string temp_url = "http%3a%2f%2fplacement.emploiquebec.net%2f"  
        + "mbe%2fut%2fsuivroffrs%2fapercoffr.asp"  
        + "%3fnooffr%3d3053675%26page%3drech%26prov%  
  3derechroffr%252Easp%26CL%3denglish";  
  string url = HttpUtility.UrlDecode(temp_url); 

0 comments:

Post a Comment