由於我經常去博客網看一些高手的文章,也常常看到他們利用工具將自己的程式碼格式化後在貼上來,整個的規格相當整齊,真是令我羨慕~~還好現在找到了CodeHighlighter 。
要完整安裝使用這套服務,不僅僅要將轉換出來的程式碼複製過來,還要事先將數個檔案複製過來,貼在自己目錄下的 /Images/OutliningIndicators/ ,要有哪些檔案呢? 就先複製以下的這些檔案吧。 完整檔案
namespace ConsoleApplication2
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
int i = 0;
try
{
throw new FileNotFoundException();
}
catch(FileNotFoundException e)
{
//FileNotFoundException e
}
catch(Exception e)
{
//Exception e
}
finally
{
//finally
}
}
}
}