user348173
user348173

Reputation: 9278

Block websites programmatically

The program has a black list, it contains a list of sites. When the user opens the site in IE (Firefox, Opera, Chrome) he should get an error. (For example 404). How can I do? It is advisable not writing to the file HOSTS. Language C#.

Upvotes: 0

Views: 2636

Answers (2)

Matteo Mosca
Matteo Mosca

Reputation: 7448

The concept behind what you're trying to do is monitoring port 80 outgoing traffic and block any requests addressed to sites/ips contained in the black list.

It's kind of complex posting for you the whole code here.

Regardless, this kind of operation is best suited to a network firewall filter than to a custom C# app that runs on the client.

Upvotes: 0

sum1stolemyname
sum1stolemyname

Reputation: 4552

What you are describing is a Proxy server:

http://www.squid-cache.org/

Upvotes: 2

Related Questions