How to block a website programatically using DotNet


Answers

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.

Question

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 is I have to block complete website not a single url.

So can some one help me to solve this problem

Thanking You

Chaithanya




You're going about it the wrong way. You don't want to intercept at the browser level - I'll use a browser or method you've never heard of to get where I want to go. You need to go deeper. Own the network interface or the operating system's network communication (e.g. the hosts file as people said) and authenticate each connection. Ideally, own it outside of the computer - at the network infrastructure level.




Detect browser URL

you can not access to internet browsers from winform projects but you can access if you have a plug-in app. for browsers. Develop a plug-in app. and communicate with your winform app. like internet download manager app. here is expamle for IE add-ons IE add-on express for chrome Google dev guide

hopefully helps it.




  1. Create simple http proxy solutions with exclusion list (or look for ready to use solution)
  2. Restrict internet access to access only using Your proxy




Tags