2
Good, I have the following code in my program:
CODE
private void button1_Click(object sender, EventArgs e)
{
openFileDialog1.Filter = "Ficheiro de Configuração (*.cnf)|*.cnf|Ficheiro de Request (*.csr)|*.csr";
DialogResult resposta = openFileDialog1.ShowDialog();
if (resposta == DialogResult.OK)
{
string arquivo = openFileDialog1.FileName;
VariaveisGlobais.CNF = arquivo;
VariaveisGlobais.CSR = label2.Text;
}
label2.Text = Path.GetFileNameWithoutExtension(openFileDialog1.FileName);
button2.Enabled = true;
button3.Enabled = true;
textBox3.Text = openFileDialog1.FileName;
}
As you can see, when Filedialog receives something, it puts button2 and button3 = Enabled. What I want now is that if you choose a file . cnf button2 gets Enabled = true; and button3 Enabled = false;
And if you choose the . csr file the other way around. Can you help? Thank you.