博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
蚊子132 给大家写一段最简单的CFileFind 源码
阅读量:3516 次
发布时间:2019-05-20

本文共 1112 字,大约阅读时间需要 3 分钟。

地址:

文件查找在一般的项目开发中是经常用到的, 今天就给大家写一段最简单的CFileFind 源码:

Example

CFileFind finder;static const TCHAR szFileToFind[] = _T("C:\\WINDOWS\\SYSTEM.INI");BOOL bResult = finder.FindFile(szFileToFind);if (bResult){   finder.FindNextFile();   cout << "Root of " << szFileToFind;   cout << " is " << (LPCTSTR) finder.GetRoot();   cout << endl;   cout << "Title of " << szFileToFind;   cout << " is " << (LPCTSTR) finder.GetFileTitle();   cout << endl;   cout << "Path of " << szFileToFind;   cout << " is " << (LPCTSTR) finder.GetFilePath();   cout << endl;   cout << "URL of " << szFileToFind;   cout << " is " << (LPCTSTR) finder.GetFileURL();   cout << endl;   cout << "Name of " << szFileToFind;   cout << " is " << (LPCTSTR) finder.GetFileName();   cout << endl;   finder.Close();}else   cout << "You have no " << szFileToFind << " file." << endl;

Example Output

Assumes that the file C:\WINDOWS\SYSTEM.INI exists:

Root of C:\WINDOWS\SYSTEM.INI is C:\WINDOWSTitle of C:\WINDOWS\SYSTEM.INI is SYSTEMPath of C:\WINDOWS\SYSTEM.INI is C:\WINDOWS\SYSTEM.INIURL of C:\WINDOWS\SYSTEM.INI is file://C:\WINDOWS\SYSTEM.ININame of C:\WINDOWS\SYSTEM.INI is SYSTEM.INI



转载地址:http://rxxqj.baihongyu.com/

你可能感兴趣的文章
常见的光纤接头汇总
查看>>
半导体激光器—问题整理(二)
查看>>
科研日记7.31
查看>>
问题整理3
查看>>
zemax仿真二向色镜
查看>>
stm32单片机编程时extern的用法
查看>>
UART4和5的问题
查看>>
Spring框架中在并发访问时的线程安全性
查看>>
网站部署
查看>>
什么情况下会发生栈内存溢出。
查看>>
何为去中心化
查看>>
本地缓存的优缺点
查看>>
缓存一致性:写策略
查看>>
Cache一致性:MESI
查看>>
缓存一致性:写未命中
查看>>
为什么用中间位作为组索引
查看>>
缓存:局部性
查看>>
mysql原理:b+树索引
查看>>
mysql原理:最左原则
查看>>
mysql原理:join标到底是什么,为什么有军规不建议超过三个
查看>>