how to get domain part from URL

This is a discussion on how to get domain part from URL within the C# Programming forums, part of the General Programming Boards category; Hello everyone, Suppose I have an URL, and I want to get the domain part, for example, URL is, http://abc.com/some/address/abc.html ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    how to get domain part from URL

    Hello everyone,


    Suppose I have an URL, and I want to get the domain part, for example, URL is, http://abc.com/some/address/abc.html, the domain is abc.com.

    My questions are,

    - Are there any existing utility class to do this? Not all URLs begins with protocol part, like http://, and not all ends with /, so I feel hard when I try to write a parser by myself;

    - Is domain case sensitive or not? i.e. abc.com the same as ABc.Com?


    thanks in advance,
    George

  2. #2
    ♥Sexy Coding Hunk♥ CartoonLarry's Avatar
    Join Date
    Dec 2003
    Location
    Michigan
    Posts
    50
    Regex Class

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    I searched and found. You should try it, it's really easy.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. !!!Urgent Help on a group project!!!!!
    By AmeenR in forum C Programming
    Replies: 3
    Last Post: 12-13-2003, 08:22 PM
  2. finding the decimal part of a number
    By Geo-Fry in forum C++ Programming
    Replies: 13
    Last Post: 07-31-2003, 12:43 PM
  3. Suspicious Pointer Conversion
    By mr_spanky202 in forum C Programming
    Replies: 35
    Last Post: 04-11-2003, 12:35 PM
  4. Beginning MFC (Prosise) Part III - Now What? :: C++
    By kuphryn in forum C++ Programming
    Replies: 5
    Last Post: 03-03-2002, 05:58 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21