Hi 
I was asked by my friend if there was a way (with code) to stop someone from accessing a web site.
I can modify the 'hosts' file which will ban the whole site - but not a sub domain of that site.
e.g   www.bbc.co.uk - ok
but   www.bbc.co.uk/page1 is the one I want to stop not www.bbc.co.uk 
not that I want to ban the bbc site - just an example 
is there a to do this with code ?
and can you open / close internet ports so you can allow or stop IM programs / Intenet access or in general have control over what a person can do on the internet.
This is something I have no experience in - can any one help or have any ideas.
Thanks,
Andy.
			
			
			
				Such blocking is possible in several ways. The common method is a local proxy server with some kind of filtering (like proxomitron), but the browser must be configured to use this proxy.
More advanced way is a local DNS server + HTTP server. The DNS server should redirect *.bbc.co.uk to the HTTP server, and the http server should filter out the /page1/ "folder". The browser should not use any proxy. If it uses one, the local DNS server should "hook" it if possible.
But all blocking methods are useless if the user uses a proxy (ex. hidemy*ss.com).
Port filtering is build-in the system, at least XP has one, see in the properties of your network card. There is also an easy to compile and configure driver (DrvFltIp).