ghx88

asp.net2 统一搜索引擎关键字编码[转]

程序代码

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text.RegularExpressions;
using System.Text;

/// <summary>
/// 搜索引擎处理
/// </summary>

public class ExJudgeSystem
{
    
public ExJudgeSystem()
    
{

    }

    
初始化变量

    
搜索引擎关键字

    
//判断否为搜索引擎爬虫,并返回其类型
    public string isCrawler(string SystemInfo)
    
{
        
string[] BotList = new string[] "Google""Baidu""MSN""Yahoo""TMCrawler""iask""Sogou" };
        
foreach (string Bot in BotList)
        
{
            
if (SystemInfo.ToLower().Contains(Bot.ToLower()))
            
{
                
return Bot;
            }

        }

        
return "null";
    }

}

posted on 2007-12-25 16:43  ghx88  阅读(365)  评论(0编辑  收藏  举报

导航