I'm not sure you understand ports entirely, I couldn't gather that from your post.
Your computer won't make the outgoing connection on port 80. It will choose some random high number port. Port 80 is the INBOUND port for a HTTP server, but it doesn't necessarily have to be port 80. I could tell my browser to go to port 3001 and if a web server was running there it would give me back HTML.
In most cases your best bet is to install a firewall (which can block inbound and outbound traffic depending on its destination). If you need to do this programatically then I suggest google searching on how to build a firewall. (It will involve packet sniffing) =)
When you say block the internet, what exactly do you want? The internet is an International Network and does not solely consist of Websites. (example; Voice Over IP, FTP, SMTP etc.)
What is the final goal of what you wish to achieve? Please describe it in detail and I'll try and provide you with the best way to go about it.
EDIT: If you truly wish to block the internet, write an application or script that removes the default gateway from the network adapter configuration. This will effectively "block" outbound connections to the internet.
Ok here is what I want to achieve. I need to block all Internet traffic, Emails (SMTP), and FTPs I should be able to re-enable it also programatically. Your method of removing gateway seems good. will you explain a little bit?
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...