How to get IIS application name?

Discussion in 'ASP General' started by Sharon, Oct 20, 2003.

  1. Sharon

    Sharon Guest

    Hi all,

    Is it possible to programmatically get the IIS application
    name at run time? If so, how?

    A software package we bought requires some cache file
    generated on the server, since we have multiple instance
    of the application running on that server (pre-staging,
    staging and production) so we need to configure the web to
    use the correct cache folder at run time based on
    application name.

    here is the set up we try to accomplish:

    cache file location

    A.) C:/cachefolder/pre-staging
    B.) C:/cachefolder/staging
    C.) C:/cachefolder/production

    (a config file will be located at the root of these
    virtual directories)

    http://myserver/pre-staging
    http://myserver/staging
    http://myserver/production

    so at run time, how can we get the application name so
    that :

    if appName = "pre-staging" then map to dir A
    if appName = "staging" then map to dir B
    if appName = "production" then map to dir C

    TIA for any help points me to the right direction is
    appreciated!

    Best Regards,

    Sharon
    Sharon, Oct 20, 2003
    #1
    1. Advertising

  2. "Sharon" <> wrote in message
    news:044c01c39743$99c7d880$...
    > Hi all,
    >
    > Is it possible to programmatically get the IIS application
    > name at run time? If so, how?
    >
    > A software package we bought requires some cache file
    > generated on the server, since we have multiple instance
    > of the application running on that server (pre-staging,
    > staging and production) so we need to configure the web to
    > use the correct cache folder at run time based on
    > application name.
    >
    > here is the set up we try to accomplish:
    >
    > cache file location
    >
    > A.) C:/cachefolder/pre-staging
    > B.) C:/cachefolder/staging
    > C.) C:/cachefolder/production
    >
    > (a config file will be located at the root of these
    > virtual directories)
    >
    > http://myserver/pre-staging
    > http://myserver/staging
    > http://myserver/production
    >
    > so at run time, how can we get the application name so
    > that :
    >
    > if appName = "pre-staging" then map to dir A
    > if appName = "staging" then map to dir B
    > if appName = "production" then map to dir C
    >
    > TIA for any help points me to the right direction is
    > appreciated!


    If you've got different paths, why not just parse out
    Request.ServerVariables("URL") to figure out what script is running?

    --
    Tom Kaminski IIS MVP
    http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
    http://mvp.support.microsoft.com/
    http://www.microsoft.com/windowsserver2003/community/centers/iis/
    Tom Kaminski [MVP], Oct 20, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthew Louden
    Replies:
    3
    Views:
    5,878
    Sherif ElMetainy
    Nov 7, 2003
  2. Bob Rock
    Replies:
    2
    Views:
    353
    Bob Rock
    Jun 14, 2004
  3. =?iso-8859-1?B?bW9vcJk=?=
    Replies:
    7
    Views:
    810
    Roedy Green
    Jan 2, 2006
  4. ding feng
    Replies:
    2
    Views:
    2,790
    ding feng
    Jun 25, 2003
  5. Bobby Chamness
    Replies:
    2
    Views:
    2,380
    Joe Smith
    Apr 22, 2007
Loading...

Share This Page