Find the server part of the url, and the virtual root folder

Discussion in 'ASP .Net' started by NWx, Feb 17, 2004.

  1. NWx

    NWx Guest

    Hi,

    Is there any way to get the server part of the URL, without parsing
    request.url by myself?
    And also, how van I get the virtual root folder of my application?

    Thanks
     
    NWx, Feb 17, 2004
    #1
    1. Advertisements

  2. > Is there any way to get the server part of the URL, without parsing
    > request.url by myself?


    You might want to check out the uri class

    i think uri.authority might be what you are looking for

    "NWx" <> wrote in message
    news:...
    > Hi,
    >
    > Is there any way to get the server part of the URL, without parsing
    > request.url by myself?
    > And also, how van I get the virtual root folder of my application?
    >
    > Thanks
    >
    >
     
    A Lonely Programmer, Feb 17, 2004
    #2
    1. Advertisements

  3. NWx

    mikeb Guest

    NWx wrote:
    > Hi,
    >
    > Is there any way to get the server part of the URL, without parsing
    > request.url by myself?
    > And also, how van I get the virtual root folder of my application?
    >


    Server : Request.Url.Host

    Path: Request.Url.AbsolutePath - in this case you will need to do a bit
    of parsing to get rid of the file requested (if there is one in the
    URL), if you just want the directory


    --
    mikeb
     
    mikeb, Feb 17, 2004
    #3
    1. Advertisements

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. Cortes
    Replies:
    4
    Views:
    1,546
    Cortes
    Jun 8, 2004
  2. Jon Maz
    Replies:
    12
    Views:
    6,219
    Vadim Chekan
    Jul 1, 2004
  3. Steve Franks
    Replies:
    20
    Views:
    4,895
    doodilydoodily
    Dec 7, 2009
  4. Jéjé
    Replies:
    2
    Views:
    517
    Jéjé
    Nov 30, 2005
  5. Thomas Jespersen

    How to get full url of virtual root

    Thomas Jespersen, May 22, 2006, in forum: ASP .Net
    Replies:
    13
    Views:
    15,515
    Rype69
    Mar 15, 2010
  6. Mr. X.

    Find root folder of the site.

    Mr. X., Jan 31, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    466
    Juan T. Llibre
    Jan 31, 2009
  7. davidkclark

    Tilde (~) virtual root url results in 404

    davidkclark, Mar 3, 2009, in forum: ASP .Net
    Replies:
    0
    Views:
    609
    davidkclark
    Mar 3, 2009
  8. ~greg
    Replies:
    5
    Views:
    379
    ~greg
    Apr 27, 2005
Loading...