During this period of time, you can use vs2010 to connect to the database to ensure the password and password verification.
But here I think of a pseudo-password verification problem implemented by using files. For details, refer. The implementation code is as follows:
Code:
1 # include <stdio. h> 2 # include <string. h> 3 # define max 100 4 5 Int main () 6 {7 file * FP; 8 fp = fopen ("F: \ secret. PWD "," R "); // open" F: \ secret in read-only mode. PWD "9 If (FP = NULL) 10 {11 printf (" can not open this file. \ n "); 12} 13 else14 {15 char C [Max], ch; 16 memset (C, 0, sizeof (c); 17 CH = fgetc (FP ); 18 int I; 19 char mycode [Max]; 20 for (I = 0; ch! = EOF; ++ I) // assign the string in the file to C [] 21 {22 C [I] = CH; 23 CH = fgetc (FP) before the terminator ); 24} 25 int Len = strlen (c); // take the length of the C string 26 if (LEN) // The length is 0, that is, there is no string 27 {28 scanf ("% s", mycode); 29 If (! Strcmp (mycode, c) // verify that the two strings are equal to 30 {31 printf ("right code. \ n "); 32} 33 else34 {35 printf (" Wrong code. \ n "); 36} 37} 38 else39 {40 printf (" Please input password. \ n "); 41 scanf (" % s ", mycode); 42 fp = fopen (" F: \ secret. PWD "," W "); 43 fprintf (FP," % s ", mycode); 44} 45} 46 fclose (FP); // close file 47 return 0; 48}
Some other operations on files are visible: http://www.cnblogs.com/edward259/archive/2010/01/13/1646339.html