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.
Kirtan PatelPosted Sep 6, 2009, 2:16 AM
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);
}
Roei BarPosted Sep 6, 2009, 2:14 AM
Request.Url.AbsoluteUri