I am developing a windows application to block the websites from a computer using DotNet windows programming.I found some results to block an url but not for a website. That
It sounds like you want the services of the System.Uri class (http://msdn.microsoft.com/en-us/library/system.uri.aspx). I'm guessing that at some point you have to decide whether or not you are going to allow or disallow a request based on the URI, in which case you will want logic similar to the following:
Uri uri = new Uri("http://www.google.co.uk/somepage.html");
if (uri.Host.ToLower().EndsWith("google.co.uk"))
{
// Do something
}
Experiment with something like that. Things to note are that:
Why are you using an application running on the local machine to do this? It doesn't make much sense. This is done through a corporate proxy, generally.
You may edit the
c:\windows\system32\drivers\etc\hosts
File to resolve a domain name to '127.0.0.1', instead of what it would normally do, to stop it being visible in that fashion. But it's better to do it properly.
Please describe what you're trying to do in more detail.