URL combine method

  • Thread starter Thread starter Bill
  • Start date Start date
Hi,

I use the Uri class for that.

Uri base = new Uri("http://localhost/test/");
Uri file = new Uri(host, "../myimage.gif");

string URL = file.AbsoluteUri;

Be careful, the Uri constructor can throw an exception if something is
not well formed, so you should place it in a try/catch block.

Sunny
 
Back
Top