If you're on the Windows XP operating system, try this link:
http://www.snapfiles.com/get/winsockxpfix.html
It's a last-resort fix for corrupted registry files that link with internet connectivity. I would also recommend going to download.com and downloading a free copy of "CCleaner". Clear all your temporary internet files, fix your registry issues, and see where it goes from there.
Also try removing any third-party firewalls or anti-virus programs, at least temporarily. Do so one at a time to see if any of those is the cause of your problem. Speaking from personal experience, I've seen a few corrupted versions of Symantec Anti-Virus/Firewall completely block all internet access to programs.
Oh, and as far as those programs you see on TV to "magically make your computer faster" (ie, "finallyfast.com"), I can guarantee you that I can find you a program for less cost, if any, less of a memory hog, and more efficient than what they offer.