I am trying to develop one application which can block all urls using win32 api on windows desktop application.
So is there any api or any procedure doing programmatically so that i can block all urls?
3 回答
It's impossible to block just URLs. If you want to make sure no one can access the internet the only way to do this would be to unplug the ethernet cable. (Or whatever is giving you connectivity) Here's why:
- Blocking all DNS resolution won't stop someone from accessing http://206.132.84.265/
- Blocking port 80 and 443 won't stop someone from accessing a web site hosted on a non-standard port.
- Denying access to IE and installation of any other software won't stop someone from downloading a browser that doesn't require to be installed (Like a text browser) and putting it on a thumb drive.
- Buying an expensive firewall that blocks HTTP traffic won't be able to stop SSL operating on a non-standard port.
Believe me, back in highschool I worked in a warehouse with a scanner gun and figured out how I could check my email with it (with a little help from my computer at home) since an internet gateway was on the same network.
If you want to block people from surfing the web, disconnect the internet.
您可以使用 Windows 防火墙协议执行此操作。这是 Microsoft 提供的 API。
对于 Vista,这很简单,但对于 XP,您需要做一些工作,因为没有可用的示例。
我想你可以使用 Windows 防火墙 API