예제 #1
0
 public static void LoadIPTable()
 {
     if (!File.Exists(g_sServerIPConfFileNmae))
     {
         g_ServerIPList.Add("127.0.0.1");
         try
         {
             g_ServerIPList.SaveToFile(g_sServerIPConfFileNmae);
         }
         catch
         {
         }
     }
     else
     {
         g_ServerIPList.Clear();
         try
         {
             g_ServerIPList.LoadFromFile(g_sServerIPConfFileNmae);
         }
         catch
         {
             MainOutMessage("加载IP列表文件 " + g_sServerIPConfFileNmae + " 出错!!!");
         }
     }
 }
예제 #2
0
        public static bool LoadAICharNameList(string sFileName)
        {
            bool result;
            int  I;

            result = false;
            if (File.Exists(sFileName))
            {
                g_AICharNameList.Clear();
                g_AICharNameList.LoadFromFile(sFileName);
                I = 0;
                while (true)
                {
                    if (g_AICharNameList.Count <= I)
                    {
                        break;
                    }
                    if (g_AICharNameList[I].Trim() == "")
                    {
                        g_AICharNameList.RemoveAt(I);
                        continue;
                    }
                    I++;
                }
                result = true;
            }
            return(result);
        }