static void Main(string[] args) { if (args.Length > 0) { AllocConsole(); ConsoleAppUtils.ParseArgs(args, out string inputFile, out string outputFile); UtilsW.ReadInputFromFile(inputFile, ' ', out int[,] res); try { Nine logic = new Nine(res); UtilsW.WriteInputIntoFile(outputFile, logic.Process()); } catch (Exception except) { Console.WriteLine(except); Console.ReadKey(); } FreeConsole(); } else { FreeConsole(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } }
private void Go_Click(object sender, EventArgs e) { try { int[,] arr2 = DataGridViewUtils.GridToArray2 <int>(arr2FromDataGridView); Nine logic = new Nine(arr2); DataGridViewUtils.ArrayToGrid(arr2ToDataGridView, logic.Process()); } catch (Exception except) { FormsUtils.ErrorMessageBox(except); } }
static void Main(string[] args) { if (args.Length > 0) { ConsoleAppUtils.ParseArgs(args, out string inputFile, out string outputFile); UtilsW.ReadInputFromFile(inputFile, ' ', out int[,] res); try { Nine logic = new Nine(res); UtilsW.WriteInputIntoFile(outputFile, logic.Process()); } catch (Exception except) { Console.WriteLine(except); Console.ReadKey(); } } else { Console.WriteLine("Аргументы командной строки не заданы"); Console.ReadKey(); } }