static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Config conf = new Config(); if (conf.Load()) { // si se ha podido cargar una configuracion Standalone s = new Standalone(); // Instanciamos un StandAlone if (s.Configure(conf)) { // si se ha configurado correctamente arrancamos la aplicacion s.initExportOnLoad = true; // indicamos que comenzamos a exportar cuando este cargado Application.Run(s); } } else { // si no existe configuracion o no se ha podido cargar mainForm = new Form1(); // Instanciamos el formulario principal Application.Run(mainForm); // y arrancamos la aplicacion } }
private void connectSilentModeBtn_Click(object sender, EventArgs e) { this.user = userInput.Text; this.password = passwordInput.Text; Form standAloneForm = new Standalone(); // formulario para programar el modo silencioso SQLServer server = new SQLServer(this.sqlserver, this.user, this.password, this.database); if (server.testConnection()) { Program.dbxml = new DBtoXML(server.getConnection()); Program.dbName = this.database; this.saveConf(); standAloneForm.Show(); this.Hide(); } else { Alert.Warning("Error al conectarse con la base de datos"); } }