zoukankan      html  css  js  c++  java
  • 最简单的设置Title和关键字方法,方便你做搜索引擎检索

    public class PageSeo
        {
            public static void getSeoInfo(string pages)
            {
                try
                {
                    string strsql = "select title,keyword,description from pageSeo where page='" + pages + "'";
                    DataSet ds = ErnieManager.getDatasetByStrsql(strsql);
                    if (ds.Tables[0].Rows.Count < 0)
                    {

                    }
                    else
                    {
                        string titleInfo = "<title>" + ds.Tables[0].Rows[0]["title"] + "</title>";
                        string keywordInfo = "<meta name=\"keywords\" content=\"" + ds.Tables[0].Rows[0]["keyword"] + "\" />";
                        string description = "<meta name=\"description\" content=\"" + ds.Tables[0].Rows[0]["description"] + "\">";
                        System.Web.HttpContext.Current.Response.Write(titleInfo + keywordInfo + description);
                    }
                }
                catch (Exception ex)
                {
                }
            }
        }

    很久很久之前写的,方法也许不是太好,期待有你的更好办法!

    qq讨论群  :  171560784

  • 相关阅读:
    python之redis
    redis 双写一致性问题
    MySQL主从复制与读写分离
    高并发下Redis如何保持数据一致性(避免读后写)
    redis的no-appendfsync-on-rewrite参数
    Redis基础、高级特性与性能调优
    python连接redis sentinel集群
    ListView阻尼效果
    零基础学python-5.6 数字位操作与其它工具
    iOS 实现QQ界面
  • 原文地址:https://www.cnblogs.com/kezhiping/p/3048955.html
Copyright © 2011-2022 走看看