Get the exact URL host name

Discussion in 'ASP .Net' started by =?Utf-8?B?U3RlcGhhbmU=?=, Sep 19, 2006.

  1. Hi,

    Is there a way to know what exactly a hostname is?

    Per example, we can have the domain « domain.qc.ca » and it could come in
    one of those forms:

    www.domain.qc.ca
    sub.domain.qc.ca
    domain.qc.ca

    And so on...

    I'd like to have only the name « domain.qc.ca ». Same thing for any domain
    with any extension like .com, .net, .fr, .on.ca, or whatever the extension
    could be

    Any idea?

    Thanks

    Stephane
     
    =?Utf-8?B?U3RlcGhhbmU=?=, Sep 19, 2006
    #1
    1. Advertising

  2. Request.Url.Host should do it for you.

    See : http://asp.net.do/test/Apppath.aspx



    Juan T. Llibre, asp.net MVP
    aspnetfaq.com : http://www.aspnetfaq.com/
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ===================================
    "Stephane" <> wrote in message
    news:...
    > Hi,
    >
    > Is there a way to know what exactly a hostname is?
    >
    > Per example, we can have the domain « domain.qc.ca » and it could come in
    > one of those forms:
    >
    > www.domain.qc.ca
    > sub.domain.qc.ca
    > domain.qc.ca
    >
    > And so on...
    >
    > I'd like to have only the name « domain.qc.ca ». Same thing for any domain
    > with any extension like .com, .net, .fr, .on.ca, or whatever the extension
    > could be
    >
    > Any idea?
    >
    > Thanks
    >
    > Stephane
     
    Juan T. Llibre, Sep 19, 2006
    #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. Scott Allen
    Replies:
    0
    Views:
    2,126
    Scott Allen
    Apr 24, 2004
  2. Joey
    Replies:
    0
    Views:
    367
  3. Orpheus66
    Replies:
    0
    Views:
    4,527
    Orpheus66
    Jul 30, 2003
  4. Anil G
    Replies:
    4
    Views:
    23,316
    v_parthi
    Jan 31, 2008
  5. Gabriella
    Replies:
    2
    Views:
    130
    Thomas 'PointedEars' Lahn
    Oct 12, 2007
Loading...

Share This Page