Lucasd
Messages postés76Date d'inscriptionlundi 21 février 2005StatutMembreDernière intervention18 mai 2006
-
10 mars 2006 à 11:50
Nikoui
Messages postés794Date d'inscriptionvendredi 24 septembre 2004StatutMembreDernière intervention19 août 2008
-
10 mars 2006 à 17:29
Salut , j'ai un form avec 2 boutons (ok et cancel)
J'ai biens dit que le boutton ok (btok) et le boutton de acceptboutton mais quand je clique dessus, j'ai tj annuler qui reviens quand je fais un writeline du résultat!!
voilà le code:
***************************************************************
public partial class queue_conf : Form
{
private int mytimerval;
private string inputfolder;
private string outputfolder;
private string mailuser;
private string mailpasswd;
private bool ok;
private bool ismail;
private bool startnow;
string errormsg = "The following error(s) occured:\n\n";
bool iserror = false;
int x=0;
//1. Test of the timer value validity
if (txtbxtday.Text != "")
{
x += Convert.ToInt32(txtbxtday.Text) * 86400000;
}
if (txtbxthour.Text != "")
{
x += Convert.ToInt32(txtbxthour.Text) * 3600000;
}
if (txtbxtmin.Text != "")
{
x += Convert.ToInt32(txtbxtmin.Text) * 60000;
}
if (txtbxtsec.Text != "")
{
x +=Convert.ToInt32(txtbxtsec.Text) * 1000;
}
if (x > 2073600000 || x < 5000)
{
iserror = true;
errormsg += "-Timer value must be between 5 second and 24 days\n";
}
//2.checking errors in the folder or mail paramaters
//First, we check if folder radio button is checked
if (fileradioButton.Checked == true)
{
if (txtbxinputfile.Text == "")
{
iserror = true;
errormsg += "-You must select an input folder\n";
}
if (txtbxoutputfile.Text == "")
{
iserror = true;
errormsg += "-You must select an output folder\n";
}
}
else
{
if (txtbxinputmail.Text == "")
{
iserror = true;
errormsg += "-You must select an output folder\n";
}
if (txtbxmail.Text == "")
{
iserror = true;
errormsg += "-You must enter an E-mail adress\n";
}
if (txtbxpasswd.Text == "")
{
iserror = true;
errormsg += "-You must enter a password\n";
}
}
//3. If no error we exit, else, we continue
if (iserror == true)
{
ok = false;
MessageBox.Show(errormsg, "Configuration error(s)", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{