private void button4_Click(object sender, EventArgs e) { ModMenu s = new ModMenu(); s.Show(); this.Hide(); }
private void btningresar_Click(object sender, EventArgs e) { if (txtUser.Text.Equals("admin") && txtPass.Text.Equals("admin1")) { MessageBox.Show("Bienvenido Administrador"); ModMenu menu = new ModMenu(); menu.Show(); this.Hide(); } else { MessageBox.Show("Revise sus credenciales"); } }
private void btnIngresar_Click(object sender, EventArgs e) { ContTrain = ContTrain + 1; trainingImages.Add(TrainedFace); // Variables para guardar en archivo nombre = txtNombre.Text; rut = txtRut.Text; fecha = fechaRegistro; perfil = boxPerfil.Text; byte[] arr = null; // Agregar los campos al archivo Labels.txt labels.Add(nombre + "-" + rut + "-" + perfil); //write no. of trained faces to list File.WriteAllText(Application.StartupPath + "/TrainedFaces/TrainedLabels.txt", trainingImages.ToArray().Length.ToString() + "%");//add library to read/write to input file //write labels or data name to file for (int i = 1; i < trainingImages.ToArray().Length + 1; i++) { trainingImages.ToArray()[i - 1].Save(Application.StartupPath + "/TrainedFaces/face" + i + ".bmp"); //sav faces to folder with name face(i)i is no. of face and .bmp extension of detected face image File.AppendAllText(Application.StartupPath + "/TrainedFaces/TrainedLabels.txt", labels.ToArray()[i - 1] + "%"); //save names to text file Image fotoGuardada = Image.FromFile(Application.StartupPath + "/TrainedFaces/face" + i + ".bmp"); // Se le indica la ruta de la imagen ImageConverter converter = new ImageConverter(); arr = (byte[])converter.ConvertTo(fotoGuardada, typeof(byte[])); } try { } catch (Exception) { throw; } MessageBox.Show("Se ha guardado imagen en base de datos."); //now load previous images and append new trainining image to it //now run ModMenu s = new ModMenu(); s.Show(); this.Hide(); }