0

Possible Duplicate:
Getting domain from subdomain

I have a query in which i am fetching Hostname from URI.

Eg. if i have http://www.google.com/abc/abcd/ade/a.htm

then the url is "www.google.com" 

var uri = new Uri("http://www.google.com/abc/abcd/ade/a.htm");
uri.Host // i get www.google.com

But when i try it with Subdomain i want to exclude the Subdomain from the url

var uri = new Uri("http://mail.google.com/abc/abcd/ade/a.htm");
    uri.Host // i get mail.google.com

I want only google.com
Community
  • 1
  • 1
Moiz
  • 2,409
  • 5
  • 27
  • 50

0 Answers0