using System;

namespace Stat.Items
{
   public class Engine
    {
        /// <summary>
        /// 搜索引擎列表
        /// </summary>
        /// <returns></returns>
       public static String[,] Get()
       {
           string[,] ss = new string[9, 2];

           ss[0, 0] = "1";
           ss[0, 1] = "其他";

           ss[1, 0] = "2";
           ss[1, 1] = "百度";

           ss[2, 0] = "3";
           ss[2, 1] = "搜狗";

           ss[3, 0] = "4";
           ss[3, 1] = "Soso";

           ss[4, 0] = "5";
           ss[4, 1] = "Google";

           ss[5, 0] = "6";
           ss[5, 1] = "Yahoo!";

           ss[6, 0] = "7";
           ss[6, 1] = "有道";

           ss[7, 0] = "8";
           ss[7, 1] = "Bing";

           ss[8, 0] = "9";
           ss[8, 1] = "Iask";

           return ss;
       }
        /// <summary>
        /// 根据 搜索引擎编号  获取搜索引擎名称
        /// </summary>
        /// <param name="Eno">编号</param>
        /// <returns>搜索引擎名称</returns>
        public static string NumberToEngine(string Eno)
        {
            string[,] arrSs =Get();//搜索引擎名称列表
            string ss = "其他";
            for (int i = 0; i < arrSs.GetLength(0); i++)
            {
                if (arrSs[i, 0].ToString() == Eno)
                {
                    ss = arrSs[i, 1].ToString();
                }
            }
            return ss;
        }
        /// <summary>
        /// 根据 搜索引擎名称  获取 搜索引擎编号
        /// </summary>
        /// <param name="Ename">引擎名称</param>
        /// <returns>搜索引擎名称</returns>
        public static string EngineToNumber(string Ename)
        {
            string[,] arrSs =Get();//搜索引擎名称列表
            string ss = "0";
            for (int i = 0; i < arrSs.GetLength(0); i++)
            {
                if (arrSs[i, 1].ToString() == Ename)
                {
                    ss = arrSs[i, 0].ToString();
                }
            }
            return ss;
        }
    }
}
