Get top level URL Domain
Hi everyone. I'm trying to modify the WebBrowser control in order to limit where users can go. In order to do this, I need to know the top level domain for all sites I go to. For example, if I go to www.wwe.com and then click on the superstars link, the new site would be www.wwe.com/superstars, but the top level domain is still www.wwe.com. I need a way to check that top level domain. Please help.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Roei BarRank #1,271 · 1.4K reputationPosted Sep 5, 2009, 10:14 PM EDT
Request.Url.AbsoluteUri
Kirtan PatelRank #292 · 8.6K reputationPosted Sep 5, 2009, 10:16 PM EDT
dont Forget to mark "Do you like answer" please it will give me some credits :)
protected void Button1_Click(object sender, EventArgs e)
{
Uri u = new Uri("http://yahoo.com/test/hello");
MessageBox.Show("http://"+u.Host);
}