예제 #1
0
        public static void ReadConfig()
        {
            Twitter_API.showList.m_showlist.Clear();
            Console.WriteLine("Read Config:Loging......");
            if (!File.Exists("TwitterConfig.conf"))
            {
                //写入配置文件
                File.WriteAllText("TwitterConfig.conf", null);
                File.WriteAllText("ReadMe", "Hi Write Config Line a One.");
                Console.WriteLine("Out Write Config:Ok");
                Console.WriteLine("Plese,Close reset run");
                Console.ReadKey();
                return;
            }
            string   Temp_team = "";
            ShowData Temp_Show = null;

            string[] Str = File.ReadAllLines("TwitterConfig.conf");
            foreach (string GetName in Str)
            {
                //初始化获取列表
                if (GetName.Contains("["))
                {
                    if (Temp_Show != null)
                    {
                        Twitter_API.showList.Add(Temp_team, Temp_Show);
                    }
                    Temp_team = GetName.Replace("[", "").Replace("]", "");
                    if (Temp_team != "End")
                    {
                        Temp_Show = new ShowData(Temp_team);
                    }
                    continue;
                }
                Temp_Show.Add(GetName);
                if (!Twitter_API.dataList.Searh(GetName))
                {
                    Twitter_API.dataList.Add(GetName);
                }
            }
            Console.WriteLine("Read Config:Ok");
            Console.WriteLine("导入组合数:{0}", Twitter_API.showList.m_showlist.Count.ToString());
            Console.WriteLine("导入偶像数:{0}", Twitter_API.dataList.m_data.Count.ToString());
        }
예제 #2
0
 public void Add(string name, ShowData datalist)
 {
     m_showlist.Add(name, datalist);
 }