Ejemplo n.º 1
0
 private void LoadArchiveConfig()
 {
     if (File.Exists(configFile))
     {
         using (StreamReader sr = File.OpenText(configFile))
         {
             string s = "";
             while ((s = sr.ReadLine()) != null)
             {
                 Console.WriteLine("Reading: " + s);
                 string[] entries = s.Split('|');
                 if (entries[0].Equals("Archive"))
                 {
                     Archive archive = new Archive(entries[1], ulong.Parse(entries[2]), entries[3], ulong.Parse(entries[4]));
                     archive.AddArchive();
                 }
             }
         }
     }
     else
     {
         using (StreamWriter sw = new StreamWriter(configFile))
             sw.WriteLine("Beetlebot Configuration File - Date: " + DateTime.Now.ToString("dddd, dd MMMM yyyy hh:mm:sstt"));
     }
 }