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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top