hello
i'm pretty new into programming and i need help
with something like authentication program
it should works like that:
there are directories like this
c:\
|
auth[dir]
/ \
john[dir] cow[dir]
| |
auth.dat auth.dat
auth dat include string "authlevel={0 or 1}"
now program search for auth.dat files in subdirectories
of auth directory,then check auth level in auth.dat files
and print different output for each auth level
for now i have only this part of code:
Code:
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
WIN32_FIND_DATA FindFileData;
HANDLE hFind = FindFirstFile("c:\auth\*.dat", &FindFileData);
if (hFind != INVALID_HANDLE_VALUE) {
do
{
if( FindFileData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY )
printf("<dir>");
printf ("%s\n", FindFileData.cFileName);
}
while (FindNextFile(hFind, &FindFileData));
}
FindClose(hFind);
return 0;
}
as you see it only search for *.dat files in c:\auth\ dir
so my problem is: how to make this program search every dir
in c:\auth\ for dat files and read them ?
thanks in advance