static void Main(string[] args) { if (args[1] == "true") { Application.EnableVisualStyles(); Application.Run(new ProfileSelector(args[0])); } else { if (args[0] == "null") { args[0] = ""; } using (CodeCompiler compiler = new CodeCompiler(args[0] + "\\Bots\\SmartCC\\Profiles\\Defaut\\", args[0])) { if (compiler.Compile()) { } } String path = args[0] + "\\Bots\\SmartCC\\Profile.current"; using (var stream = new FileStream(path, FileMode.Truncate)) { using (var writer = new StreamWriter(stream)) { writer.WriteLine("Defaut"); writer.Close(); } } } }
private void button1_Click(object sender, EventArgs e) { Console.OutputEncoding = Encoding.UTF8; using (CodeCompiler compiler = new CodeCompiler(BotDirectory + "Bots\\SmartCC\\Profiles\\" + comboBox1.SelectedItem.ToString() + "\\", BotDirectory)) { if (compiler.Compile()) { } else { } } Close(); StreamWriter writer = new StreamWriter(BotDirectory + "Bots\\SmartCC\\Profile.current"); writer.WriteLine(comboBox1.SelectedItem.ToString().Substring(1)); writer.Close(); }
public DebugForm() { InitializeComponent(); CardTemplate.DatabasePath = System.IO.Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]) + "/"; CardTemplate.LoadAll(); StreamReader str = new StreamReader(CardTemplate.DatabasePath + "Bots/SmartCC/Config/useProfiles"); string useDefaut = str.ReadLine(); str.Close(); if (useDefaut == "true") { Application.EnableVisualStyles(); Application.Run(new ProfileSelector(CardTemplate.DatabasePath)); } else { using (CodeCompiler compiler = new CodeCompiler(CardTemplate.DatabasePath + "\\Bots\\SmartCC\\Profiles\\Defaut\\", CardTemplate.DatabasePath)) { if (compiler.Compile()) { } } String path = CardTemplate.DatabasePath + "\\Bots\\SmartCC\\Profile.current"; using (var stream = new FileStream(path, FileMode.Truncate)) { using (var writer = new StreamWriter(stream)) { writer.WriteLine("Defaut"); writer.Close(); } } } s = new Simulation(); }
private void button1_Click(object sender, EventArgs e) { if (comboBoxProfiles.Text != "") { using (CodeCompiler compiler = new CodeCompiler(BotDirectory + "" + Path.DirectorySeparatorChar + "Bots" + Path.DirectorySeparatorChar + "SmartCC" + Path.DirectorySeparatorChar + "Profiles" + Path.DirectorySeparatorChar + "" + comboBoxProfiles.SelectedItem.ToString() + Path.DirectorySeparatorChar, BotDirectory)) { if (compiler.Compile()) { } else { } } Close(); StreamWriter writer = new StreamWriter(BotDirectory + "" + Path.DirectorySeparatorChar + "Bots" + Path.DirectorySeparatorChar + "SmartCC" + Path.DirectorySeparatorChar + "Profile.current"); writer.WriteLine(comboBoxProfiles.SelectedItem.ToString().Substring(1)); writer.Close(); } else { MessageBox.Show("Error: you didn't select a profile from the list", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }