views:

104

answers:

2

Hi,

I want to make a simple program that can restrict any communication over the internet except for some specific ip's. So that the user can eliminate any unwanted traffic. It has to be simple and the user must be able to switch it on and off on the fly.

My first thought was to use Windows Firewall and set it up using C#/WPF. And it might be possible. But is there a more simple way?

Platform: Vindows 7, .NET 3.5

Cheers

A: 

You are essentially creating a firewall. One or your better options would be to use an exising firewall and control it from your program. Since there is one built into windows that would be my first choice.

That said another option is to create a proxy layer into the IP stack . Finally if your users are limited to a single comms program (say IE or what not) then you could just create/use a proxy server type program.

Preet Sangha
+1  A: 

I would just use windows firewall as you mentioned. Much simpler. Here is a good tutorial on modifying the windows firewall in C#.

Jeremy Morgan