1.上SyntaxHighlighter官网下载引用文件,并上传到博客园 http://alexgorbatchev.com/SyntaxHighlighter/download/
2.文件,上传
3.记录一些两个文件的url地址
4.设置,在页首HTML代码中添加上面两个地址的引用,具体的看图
5.编辑器正常使用,如果想使用 syntaxhighlighter插件 ,就:选择编辑html代码=>添加<pre></pre>标签对,<pre>添加属性:'class="brush: 引用代码使用的语言(具体例子看下图)
6.具体案例:
eg:<pre class="brush: js;">
function helloSyntaxHighlighter() { return "hi!"; }
eg:<pre class="brush: c-sharp;">
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:检查 SQL 查询是否存在安全漏洞")] public static DataTable ExcelToDataTable(string strExcelFileName, string strSheetName) { string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + strExcelFileName + ";" + "Extended Properties=Excel 5.0;"; string strExcel = string.Format("select * from [{0}$]", strSheetName); DataSet ds = new DataSet(); using (OleDbConnection conn = new OleDbConnection(strConn)) { conn.Open(); OleDbDataAdapter adapter = new OleDbDataAdapter(strExcel, strConn); adapter.Fill(ds, strSheetName); conn.Close(); return ds.Tables[strSheetName]; } }
发完我才发现,,,博客园现在也已经内置了。。。。。看看吧,当涨个经验
博客园内置的编辑器:
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2100:检查 SQL 查询是否存在安全漏洞")] public static DataTable ExcelToDataTable(string strExcelFileName, string strSheetName) { string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + strExcelFileName + ";" + "Extended Properties=Excel 5.0;"; string strExcel = string.Format("select * from [{0}$]", strSheetName); DataSet ds = new DataSet(); using (OleDbConnection conn = new OleDbConnection(strConn)) { conn.Open(); OleDbDataAdapter adapter = new OleDbDataAdapter(strExcel, strConn); adapter.Fill(ds, strSheetName); conn.Close(); return ds.Tables[strSheetName]; } }