zoukankan      html  css  js  c++  java
  • 【过时】博客园中使用syntaxhighlighter插件(图文详细版本)

    1.上SyntaxHighlighter官网下载引用文件,并上传到博客园 http://alexgorbatchev.com/SyntaxHighlighter/download/

    2.文件,上传

    3.记录一些两个文件的url地址 

     4.设置,在页首HTML代码中添加上面两个地址的引用,具体的看图

    5.编辑器正常使用,如果想使用 syntaxhighlighter插件 ,就:选择编辑html代码=>添加<pre></pre>标签对,<pre>添加属性:'class=" 引用代码使用的语言(具体例子看下图)

    6.具体案例:

    eg:<pre class=" js;"> 

    function helloSyntaxHighlighter()
    {
        return "hi!";
    }
    

     eg:<pre class=" 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];
                }
            }
    

      

  • 相关阅读:
    P2176 [USACO14FEB]路障Roadblock
    洛谷 P1187 3D模型
    洛谷 P2777 [AHOI2016初中组]自行车比赛
    洛谷P2896 [USACO08FEB]一起吃饭Eating Together
    洛谷P2983 [USACO10FEB]购买巧克力Chocolate Buying
    洛谷 P2858 [USACO06FEB]奶牛零食Treats for the Cows
    Restaurant
    OR in Matrix
    poj 3321Apple Tree
    Codeforces Round #204 (Div. 2) C. Jeff and Rounding
  • 原文地址:https://www.cnblogs.com/dunitian/p/4828258.html
Copyright © 2011-2022 走看看