title: Get IIS site name from for an ASP.NET website
body: <p>In my ASP.NET web app I'd like to look up the name it was given when it was created in IIS, which is unique to the server. I'd not interested in the domain name for the web site but the actual name given to the site in IIS.</p>
  
  <p>I need to be able to do it reliably for IIS6 and 7.</p>
  
  <p>To be clear I'm talking about the given name in IIS, not the domain name and not the virtual directory path.</p>