|
Home > Archive > IIS Server > December 2005 > iis application name
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
iis application name
|
|
| jmcfetridge@coast.com 2005-12-02, 5:53 pm |
| is there a way to obtain the IIS application name from a running asp.net page.
| |
|
|
| Chris Crowe [MVP 1997 -> 2006] 2005-12-02, 5:53 pm |
| Yes and No
Yes - There is a ServerVariable that you can check to get the IIS Instance
ID that the web site is running in and the metabase path.
string InstanceID = Request.ServerVariables("INSTANCE_ID");
string MetabasePath = Request.ServerVariables("INSTANCE_META_PATH");
INSTANCE_ID=1388032739
INSTANCE_META_PATH=/LM/W3SVC/1388032739
Now in order to read the Metabase to get the IIS Application you would need
to be an Administrator which means that the code that does the Metabase
lookup needs to be running as a Local Administrator.
This has security ramifications.
--
Cheers
Chris Crowe [IIS MVP 1997 -> 2006]
http://blog.crowe.co.nz
------------------------------------------------
"jmcfetridge@coast.com" <jmcfetridgecoastcom@discussions.microsoft.com>
wrote in message news:9FC378C0-3672-4BC5-A216-B02BB3C82864@microsoft.com...
> is there a way to obtain the IIS application name from a running asp.net
> page.
|
|
|
|
|