Reputation: 9278
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
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