1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| private void ConnexionButton_Click(object sender, EventArgs e)
{
// initialise les composants
LoadingProgressBar.Value = 0;
// écriture des variables
bool reponse;
int step = (100/3);
// connexion internet
reponse = true;
connexionInternetPB.Image = (Bitmap)Properties.Resources.ResourceManager.GetObject("tentative_" + reponse.ToString().ToLower());
if (reponse)
{
LoadingProgressBar.Value += step;
// connexion au serveur
reponse = true;
connexionServeurPB.Image = (Bitmap)Properties.Resources.ResourceManager.GetObject("tentative_" + reponse.ToString().ToLower());
if (reponse)
{
LoadingProgressBar.Value += step;
// vérification des identifiants
reponse = true;
verifIdentifiantsPB.Image = (Bitmap)Properties.Resources.ResourceManager.GetObject("tentative_" + reponse.ToString().ToLower());
if (reponse)
{
LoadingProgressBar.Value += (100 - LoadingProgressBar.Value);
MainForm.online = true;
Close();
}
}
}
} |
Partager