I usually use FireFox, so line-numbers are not copied.
Google Chrome also does not copy line-numbers.
Unfortunately removing line numbers would not solve the issue for IE9 because it also has issues with line feeds
If I'm in IE9 I select the code, right click and 'copy to OneNote' then copy paste from there later.
From memory, pasting into WordPad from IE9 also works.
If you do find an editor that lets you post the code without stuffing-up the formatting than ALT+select the line numbers in (column mode) will help in deleting the numbers.
I dread seeing postings using the standard [ code ] formatting ... in a lot of cases I don't even bother reading them.