How can I block access to certain site until reboot, WITHOUT changing hosts file?
Here's what we'd like to achieve via a c# application. Is there a way this can be done, or is it impossible?
- Block access 开发者_如何学运维to a website (say www.stackoverflow.com) between 11am and 2pm.
- Also block access to MSN Messenger between the same hours.
- Stop the blocking if the machine is rebooted.
What's confusing us is the exact point where the blocking belongs. The only possible solution we have at the moment is programatically altering the hosts file to block and unblock certain sites. This solution would fall down on a few points.
- The user can manually change the hosts file back, which would be undesirable.
- If the user had a browser open at 11am they would have to restart it to pick up the amended hosts file.
- I'm a web developer so not entirely sure how this works, but I believe the c# app would have to be running as an administrator in order to edit the hosts file, which again would not be desirable.
To clarify, we're trying to produce something like macfreedom.com - so users's aren't going through a proxy or network that we control (unless the solution is to make the user's machine point to a proxy server but I doubt that's achievable or desirable). macfreedom.com appears to work by switching off the network adapter until reboot. We were hoping for a more subtle effect.
this should work like the most client firewalls ... a network filter driver dropping packets ... i fear you will have to use a kernel mode driver -> so .net seems to be out of the game ...
精彩评论