Exemple #1
0
 static void Main(string[] args)
 {
     try
     {
         switch (args[0].ToLower())
         {
             case "encrypt":
                 File.WriteAllBytes(args[1].Replace(".js", ".jse"), new NinoJS.Encrypt.AES().Encrypt(File.ReadAllText(args[1])));
                 System.Console.WriteLine("Encryption completed.");
                 break;
             case "decrypt":
                 File.WriteAllText(args[1].Replace(".jse", ".js"), new NinoJS.Encrypt.AES().Decrypt(File.ReadAllBytes(args[1].Replace(".js", ".jse"))));
                 System.Console.WriteLine("Decryption completed.");
                 break;
             case "run":
                 Main main = new Main();
                 main.RunScript(args[1]);
                 break;
             default:
                 new Log().LogError("Command line argument not recognized. " + args[0]);
                 break;
         }
     }
     catch (Exception ex)
     {
         System.Console.WriteLine(ex.ToString());
         new Log().LogError(ex.ToString());
     }
     finally
     {
         System.Console.Read();
     }
 }
Exemple #2
0
 private void frmMain_Load(object sender, EventArgs e)
 {
     Main main = new Main();
     main.Start();
 }