| 12
 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
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 
 |  
 
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
 
/** DATE ET HEURE LOCALE -- WINDOWS **/
    SYSTEMTIME Time;
 
    GetLocalTime(&Time);
 
    printf("Nous sommes le : %02d/%02d/%04d.\n", Time.wDay, Time.wMonth, Time.wYear);
 
    printf("Et il est : %02dh %02dmn %02ds %03dms.\n", Time.wHour, Time.wMinute, Time.wSecond, Time.wMilliseconds);
/** Fin des instructions de date - WINDOWS **/
 
 
/***** skips steps *****/
    case 2 :
 
            printf("\n Saisissez le code d'activation de la porte des etoiles : "); scanf("%d", &code1);
            if (code1 == code){
            printf("\n\n \4 Code CORRECT !\n Saisissez la combinaisons de glyphes, sous la forme suivante :\n\t1-8-16\n\n\t: ");
            scanf("%d-%d-%d", &val1, &val2, &val3); printf("\n\t - %s\n\t - %s\n\t - %s\tVoici les glyphes selectionnes\n  La porte est active !\n\n", nomGlyphe[val1], nomGlyphe[val2], nomGlyphe[val3]); nb_write++;
                }
            fichier = fopen(nomFichier, "a");
            printf("\n\t\4 Tentative d'ouverture du fichier 'historique.txt'");
 
                    if (fichier != NULL)
                    {
                        printf("\n\t\4 Ouverture du fichier 'historique.txt' : REUSSIE");
                        fprintf(fichier, "\n\n Combinaisons du [%02d/%02d] A %02dh %02dmn %02ds :\n\t\t %s[%d] || %s[%d] || %s[%d]", Time.wDay, Time.wMonth, Time.wHour, Time.wMinute, Time.wSecond, nomGlyphe[val1], val1, nomGlyphe[val2], val2, nomGlyphe[val3], val3);
                        fclose(fichier);
                        printf("\n\t\4 Mis-A-Jour du fichier 'historique.txt' : REUSSIE\n\n");
                        break;
                    }
 
                        else{
                            /**  On affiche un message d'erreur si on veut **/
                            printf("\n\n\4 Ouverture du fichier ' %s ' : ECHEC\n\n", nomFichier);
                            break;
                            }
 
            if(code1 != code) {
            printf("\n  \4 Le code d'activation semble mauvais ... "); break;
            }
            break;
/****** end skips steps *******/ |