This is a little bit confusing. You can filter traffic if you make a firewall, or a http proxy. Actually it is far more easier to find an out-of-the-box solution, than writing it for yourself. As you formulated your question it is clear that you have serious lack of knowledge regarding networking. I don't advice you to start coding such a complex thing.
If you mean the web by "internet", than you can use WebBrowser component, and fine-tune it to make a restricted browser. But you have to disable the usage of all other browsers. You can start from here:
Web Browser in C#[
^]. This is also not an easy task, because you have to deal with several things to get a working browser after all.