Steve Dunn recently released a new version of his Windows Live Writer plugin that allows you to insert code into your blog posts that properly formats and highlights everything.  It’s customizable and easy to use with a plethora of options.  This is by far the best code formatter for Live Writer out there.  And best of all, its FREE!  Here are a few samples of the different formats you can use:

Highlighted code:

        /// <summary>
        /// Retrieves all articles.
        /// </summary>
        public override List<ArticleDetails> GetArticles(int pageIndex, int pageSize)
        {
            List<ArticleDetails> articles = new List<ArticleDetails>();
            using (SqlConnection cn = new SqlConnection(this.ConnectionString))

 

Formatted code:

        /// <summary>
        /// Retrieves all articles.
        /// </summary>
        public override List<ArticleDetails> GetArticles(int pageIndex, int pageSize)
        {
            List<ArticleDetails> articles = new List<ArticleDetails>();
            using (SqlConnection cn = new SqlConnection(this.ConnectionString))

 

Code as bitmap:

 

This is a great tool – you can download the plugin here.  Enjoy!