I am currently using the following code:
<center>Application Name: <%=HostingEnvironment.ApplicationID %></center>
Which outputs:
Application Name: /LM/W3SVC/1/Root/AppName
"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.
Thanks!
To reiterate, based on the comment thread - ApplicationHost.GetSiteName()
is not intended to be used in code (see msdn.microsoft.com):
IApplicationHost.GetSiteName Method ()
This API supports the product infrastructure and is not intended to be used directly from your code.
Instead use
System.Web.Hosting.HostingEnvironment.SiteName;
Documentation at MSDN
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With