Q
Hi @ all,
ich möchte zum zwecke der Lizezierung (nur mal so)
Lizez-Keys erstellen.
Ich hab folgendes schon geschrieben:
void generator1(void)
{
int zufallszahl, zufallszahl2, zufallszahl3, zufallszahl4;
int i;
FILE *pfile;
char buf[80];
pfile = fopen ("random.txt", "a");
randomize();
printf ("Lizenz-Key Generator\r\n");
for (i = 1; i<=10; i++) {
zufallszahl = random(199999+1);
zufallszahl2 = random(199999+1);
zufallszahl3 = random(199999+1);
zufallszahl4 = random(199999+1);
printf ("Key-Nr.: %d Key: %d#**%d*#%d-#%d##\r\n", i, zufallszahl, zufallszahl2, zufallszahl3, zufallszahl4);
fprintf(pfile, "%d#**%d*#%d-#%d##\n", zufallszahl, zufallszahl2, zufallszahl3, zufallszahl4);
}
fclose(pfile);
}
void generator2(void)
{
int zufallszahl, zufallszahl2, zufallszahl3, zufallszahl4;
int i;
FILE *pfile;
char buf[80];
pfile = fopen ("random2.txt", "a");
randomize();
printf ("Lizenz-Key Generator\r\n");
for (i = 1; i<=10; i++) {
zufallszahl = random(1999999+1);
zufallszahl2 = random(1999999+1);
zufallszahl3 = random(1999999+1);
zufallszahl4 = random(1999999+1);
printf ("Key-Nr.: %d Key: %d#**%d*#%d-#%d##\r\n", i, zufallszahl, zufallszahl2, zufallszahl3, zufallszahl4);
fprintf(pfile, "%d#**%d*#%d-#%d##\n", zufallszahl, zufallszahl2, zufallszahl3, zufallszahl4);
}
fclose(pfile);
}
void generator3(void)
{
int zufallszahl, zufallszahl2, zufallszahl3, zufallszahl4;
int i;
FILE *pfile;
char buf[80];
pfile = fopen ("random3.txt", "a");
randomize();
printf ("Lizenz-Key Generator\r\n");
for (i = 1; i<=10; i++) {
zufallszahl = random(19999999+1);
zufallszahl2 = random(19999999+1);
zufallszahl3 = random(19999999+1);
zufallszahl4 = random(19999999+1);
printf ("Key-Nr.: %d Key: %d#**%d*#%d-#%d##\r\n", i, zufallszahl, zufallszahl2, zufallszahl3, zufallszahl4);
fprintf(pfile, "%d#**%d*#%d-#%d##\n", zufallszahl, zufallszahl2, zufallszahl3, zufallszahl4);
}
fclose(pfile);
}
Das waren die Generatoren der Lizenz-Keys.
Ich möchte jetzt aber überprüfen können ob ein key gültig ist, dass heißt ich will, dass #** bei jedem key aus generator1() an der gleichen stelle ist.
Wie kann ich das machen??
Bitte helft mir