.net - Retrieve subdomain, avoid ".co.uk" issue -


i retrieving domain url string i'm wondering best option , avoid getting "co" in "example.co.uk" urls.

does know algorithm or .net framework method it?

i've been looking , answers match list of tlds , list growing quickly.

edit:

i've tried uri class , haven't found i'm looking for.

i try retrieve first subdomain of string "website.example.co.uk" "example.co.uk".

once you've got hostname uri, easy enough check if ends ".co.uk", , if so, extract last 3 components; otherwise extract last 2 components. sounds accomplish you're asking for; want more general?


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -