However, for free WordPress sites which do not have access or control to install plugins, it is very hard to post your code with color syntax highlighted. I have been suffering from this, and resort to capture my code in images, which look nice, but often complained by the readers. For instance, one of my answer at StackOverflow, some coder complained: why image, not code?
To solve this problem, you can search Google with “code to html”, “code formatter” etc, and then you are directed to a bunch of very rich set of online html formatters. My favorite sites would be:
Given the code, you copy the source to the aforementioned site as input, and HTML colored, syntax highlighted code will be generated. And you can then copy the HTML to your blog writer, e.g. Windows Live Writer.
Go to the source tab of Live Writer, Copy the HTML code in the right side text block as shown below, paste it to the Source window of Live writer, modify the margin, line spaces etc to customize the code view:
I usually change the line spacing from 125% to 100%, and change the font to Consolas, as shown below: