private void TimerCRARINI_Tick(object sender, EventArgs e) { string rutaPreparar; StreamWriter sw; rutaPreparar = Path.Combine(Directory.GetCurrentDirectory(), "ConfigurationFile.ini"); rutaPreparar = rutaPreparar.Replace("Configuration.ini", @"SQLEXPR_x64_ENU\ConfigurationFile.ini"); if (File.Exists(rutaPreparar) == true) { TimerCRARINI.Stop(); } try { sw = File.CreateText(rutaPreparar); sw.WriteLine(txtArgumentosini.Text); sw.Flush(); sw.Close(); TimerCRARINI.Stop(); } catch (Exception ex) { throw; } }
private void btnInstalarServidor_Click(object sender, EventArgs e) { try { txtArgumentosini.Text = txtArgumentosini.Text.Replace("PRUEBAFINAL22", lblnombredeservicio.Text); TimerCRARINI.Start(); executa(); timer2.Start(); Panel4.Visible = true; Panel4.Dock = DockStyle.Fill; } catch (Exception ex) { MessageBox.Show(ex.Message); } }