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];
                }
            }
    

      

  • 相关阅读:
    Servlet入门
    序列化
    ConcurrentHashMap红黑树的实现
    ConcurrentHashMap1.7和1.8的源码分析比较
    TCP/IP中的传输层协议TCP、UDP
    Java内存模型和ConcurrentHashMap 1.7源码分析
    JAVA研发面试题
    面试题(Python)
    初识Python
    Python解释器安装与环境变量添加
  • 原文地址:https://www.cnblogs.com/dunitian/p/4828258.html
Copyright © 2011-2022 走看看