How to

combine absolute and relative path/url

Published: 30. January 2012 | Updated: 30. January 2012
License: Microsoft Public License (MS-PL)
Categories: File system, Network
Tags: C# File System Network
Was this snippet helpful for you? YESYES / NONO
Get Analyzant!

Check your entire website from code to content in minutes with Analyzant, the free analysis suite.

Free download at analyzant.com
Uri baseUrl = new Uri("http://www.csharpdeveloping.net");
string relativeUrl = "Images/test.jpg";
            
Uri combined = new Uri(baseUrl, relativeUrl);

Console.WriteLine(combined);
Console Output:
http://www.csharpdeveloping.net/Images/test.jpg
Send us feedback about this snippet »



Related Snippets: