示例#1
0
 private void LoadAllCommands()
 {
     try
     {
         DriveAccess.DownloadFromDrive(path);
         allfiles = Directory
                    .EnumerateFiles(path, "*", SearchOption.AllDirectories)
                    .Select(Path.GetFileNameWithoutExtension);
         //make a command for each of those files based on its name
         foreach (String com in allfiles)
         {
             Console.WriteLine(com);
             LoadCommand(com);
             config.Save(ConfigurationSaveMode.Modified);
             ConfigurationManager.RefreshSection("appSettings");
         }
     }
     catch
     {
         Console.WriteLine("Bad Folder Path");
         Environment.Exit(0);
     }
 }
 static void Main(string[] args)
 {
     DriveAccess.getAuth();
     SBBot bot = new SBBot();
 }