title: Get IIS Application Name in .NET App
body: <p>I am currently using the following code:</p>
  
  <pre><code>&lt;center&gt;Application Name: &lt;%=HostingEnvironment.ApplicationID %&gt;&lt;/center&gt;
  </code></pre>
  
  <p>Which outputs:</p>
  
  <pre><code>Application Name: /LM/W3SVC/1/Root/AppName
  </code></pre>
  
  <p>"AppName" is the value I want and I'm wondering whether there is another method that will simply return it without having to do string magic to remove the rest of the path.</p>
  
  <p>Thanks!</p>