title: How to combine URIs
body: <p>I have two Uri objects passed into some code, one is a directory and the other is a filename (or a relative path)</p>
  
  <pre><code>var a = new Uri("file:///C:/Some/Dirs");
  var b = new Uri("some.file");
  </code></pre>
  
  <p>when I try and combine them like this:</p>
  
  <pre><code>var c = new Uri(a,b);
  </code></pre>
  
  <p>I get </p>
  
  <blockquote>
    <p><code>file:///C:/Some/some.file</code></p>
  </blockquote>
  
  <p>where I wold expect to get the same effect as with <code>Path.Combine</code> (as that is the old code I need to replace):</p>
  
  <blockquote>
    <p><code>file:///C:/Some/Dirs/some.file</code></p>
  </blockquote>
  
  <p>I can't think of a clean solution to this.</p>
  
  <p>The ugly solution being to add a <code>/</code> to the Uri if it's not there</p>
  
  <pre><code>string s = a.OriginalString;
  if(s[s.Length-1] != '/')
     a = new Uri(s + "/");
  </code></pre>