Sometimes, I have to remove Internet Explorer from my quick launch thing... or just cover it up... because if it's not right there to click on, I'm not as likely to click on it. Either that, or just disconnect my freaking internet. The one good thing about dial-up was that I wasn't connected all the time... so it was easier to write when I couldn't get online. Now that I have high-speed and am on all the time, I do exactly what you do... stop in freaking mid-sentence to come here or go on YouTube or whatever. It drives me nuts, but it's like a compulsive habit.
You can't force the writing, but try removing the temptation of the internet and see if that helps. Maybe even turn off your computer and try to write some by hand. This doesn't usually work for me, but I will say, the times my computer has been broken and I've had to write by hand, I have come up with some interesting stuff... never stuff that has actually made it into a story, but interesting stuff nonetheless. Who knows.