title: Getting Filename from url in C#
body: <p>Currently we have a solution that grabs the filename from the URL using this</p>
  
  <pre><code>currentFile = Path.GetFileNameWithoutExtension(url);
  </code></pre>
  
  <p>We found that if there are query strings attached that include characters such as quotes it returns with an error of Illegal characters in path.</p>
  
  <p>For example if the url is </p>
  
  <pre><code>http:\\myurl.com\mypage.aspx?utm_content=This+Is+"Broken"
  </code></pre>
  
  <p>Then it won't get the filename. Is there a better, cleaner way to get "mypage"?</p>