FindFile.cpp
资源名称:IceSword.rar [点击查看]
上传用户:fjdqny
上传日期:2008-02-11
资源大小:921k
文件大小:1k
源码类别:
其他
开发平台:
Visual C++
- #include <windows.h>
- #include <stdio.h>
- #include "Cooperator.h"
- int main(int argc, char *argv[])
- {
- if (argc < 2)
- {
- printf("FindFile dirn");
- return -1;
- }
- printf("IsConnectServern");
- if (!IsConnectServer())
- {
- printf("ConnectAndCalln");
- ConnectAndCall();
- }
- if (!IsConnectServer())
- {
- printf("Error to connect servern");
- return -1;
- }
- DWORD ret;
- IsdGetVersion(&ret);
- printf("Icesword version : %xn", ret);
- HANDLE hFile = IsdCreateFile(argv[1], 0, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DIRECTORY, 0);
- ISD_WIN32_FIND_DATA FileData;
- int ii = 0;
- while (hFile != INVALID_HANDLE_VALUE && IsdFindFile(hFile, &FileData, 0))
- {
- ii++;
- float size = (float)FileData.nFileSize.QuadPart/1024;
- printf("FileSize:%.3fk FileName:%sn", size, FileData.cFileName);
- }
- printf("%dn", ii);
- if (hFile != INVALID_HANDLE_VALUE)
- IsdCloseHandle(hFile);
- return 0;
- }