0
I am working on my TCC and I needed to make the data collected in the register serve as login, because we do not have a server yet to store this data, so they are being done with ArrayList
.
Follows the code:
public partial class Frm_cadastro : Form
{
ArrayList Nome = new ArrayList();
ArrayList Senha = new ArrayList();
ArrayList Email = new ArrayList();
ArrayList DataNascimento = new ArrayList();
int Contador= 0;
public Frm_cadastro()
{
InitializeComponent();
}
private void btn_cadastrar_Click(object sender, EventArgs e)
{
string nome, email, senha;
nome = txt_nome.Text;
email = txt_email.Text;
senha = txt_senha.Text;
if (nome.Trim().Length == 0 || email.Trim().Length == 0 || senha.Trim().Length == 0)
{
MessageBox.Show("Todos os campos devem estar preenchidos!", "Aviso");
}
else if (chk_termos.Checked == false)
{
MessageBox.Show("Os termos devem ser aceitos!");
}
else
{
Frm_confirmacao Confirmacao = new Frm_confirmacao();
Confirmacao.Show();
this.Hide();
}
Nome.Add(txt_nome.Text);
Senha.Add(txt_senha);
Email.Add(txt_email);
DataNascimento.Add(dtp_data_nascimento.Text);
}
private void btn_voltar_Click(object sender, EventArgs e)
{
Form Principal = Application.OpenForms["frm_principal"];
Principal.Show();
this.Dispose();
}
private void Frm_cadastro_Load(object sender, EventArgs e)
{
}
}
and here the login screen, as I haven’t been able to make it capitalize the variables, I gave a specific condition, but this is not how I wanted to
private void lnk_esqueceu_senha_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Frm_esquecer_senha Senha = new Frm_esquecer_senha();
Senha.Show();
this.Hide();
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Frm_cadastro Cadastro = new Frm_cadastro();
Cadastro.Show();
this.Hide();
}
private void btn_entrar_Click(object sender, EventArgs e)
{
string email, senha;
email = txt_login.Text;
senha = txt_senha.Text;
if (email.Trim().Length == 0 || senha.Trim().Length == 0)
{
MessageBox.Show("Todos os campos devem estar preenchidos!", "Aviso");
}
else if (email != "Administrador" && senha != "Adm@2014")
{
MessageBox.Show("E-mail ou senha incorretos!");
}
else
{
Frm_pagina_inicial Inicial = new Frm_pagina_inicial();
Inicial.Show();
this.Hide();
}
}
private void txt_senha_TextChanged(object sender, EventArgs e)
{
txt_senha.PasswordChar = '*';
}
Are you sure you will use Arraylist? You are using . Net 1.1?
– Maniero
Yes because it is what we learn in class, and as we do not have bank we use the arraylist. Usk the VB 2010 but I do not know if it is the 1.1
– Nathâne
If you are using Visual Studio 2010 (not VB 2010), you are using . Net 4.0. Since version 2.0 Arraylist has been replaced by List<T> because the previous one is considered unsafe and has performance problems. The ONLY reason to use Arraylist would be not to have a more current . Net available, which is not the case. Also, I see some other problems in the code, but in order to help you, we need more specific information about what the difficulty is. If more details no one will be able to help you.
– Maniero
give way to the question please
– Rovann Linhalis